
各种转码
文章平均质量分 68
lhf1985314
这个作者很懒,什么都没留下…
展开
-
utf8串输出中文
bool Utf8ToZhong(const std::string &utf8_str, std::string *result_str) { if(utf8_str.size() == 0) { return false; } int move_flag = 0;原创 2011-09-16 13:52:10 · 657 阅读 · 0 评论 -
GB2312, GBK, utf8
inline int hashGb2312(const char* ch) { //检验是不是gb2312编码 if ( ((ch[0] + 256) % 256 - 0xA0 87) )//gb2312汉字编码高位从第16区到第87区 { return -1; } if ( ((ch[1] + 256) % 256 - 0xA0 94) )//gb2312汉字编码低位从1原创 2011-09-14 18:08:22 · 510 阅读 · 0 评论