ANSI编码格式中对汉字字符的判断

char ch[10] = "你";

int iType = (unsigned char )*ch & 0x80;
cout << iType << endl;

如果iType等于128,就说明这是一个汉字字符

转载于:https://my.oschina.net/dake/blog/196692

猜你喜欢

转载自blog.csdn.net/weixin_34059951/article/details/91507961