首先加上头文件 #include<QTextCodec> 然后设置 QTextCodec*t=QTextCodec::codecForName("GBk");最后转换 QString s=t->toUnicode("行了");结果 相关文章: