//返回0:无中文,返回1:有中文int IncludeChinese(char *str){ int nRet = 0; char c; while(c=*str++) { //如果字符高位为1且下一字符高位也是1则有中文字符 if( (c&0x80) && (*str & 0x80) ) { nRet = 1; break; } } return nRet;}
用正则表达式,对应的库,有BOOST,还有C++11都有