文本操作防止中文乱码
作者:互联网
int main
{
QTextCodec *codec = QTextCodex::codexForName("UTF-8");
QTextCodec::setCodeForLocale(codec);
QTextCodec::setCodeForCStrings(codec);
QTextCodec::setCodeForTr(codec);
QTextCodec::setCodeForCStrings(QTextCodec::codecForName("system"));
QTextCodec::setCodeForLocale(QTextCodec::codecForName("system"));
QTextCodec::setCodeForTr(QTextCodec::codecForName("system"));
QApplication a(argc,argv);
}
标签:中文,codecForName,system,setCodeForLocale,乱码,setCodeForTr,codec,QTextCodec,文本 来源: https://www.cnblogs.com/lllion/p/15018307.html