QTextStream out(&file);
out.setCodec(QTextCodec::codecForName("utf-8"));
out << s.name << ", ";
out << s.cellCnt << ", ";
out << s.startCell << ", ";
写文件到本地,使用utf-8
然后读取使用QString::fromUtf8();
QFile file(".\\configs.cfg");
char* chPart;
if(file.open(QIODevice::ReadOnly){
while(1){
chPart = ::strtok(p, ",");
QString str = QString::fromUtf8(chPart);
}
}
file.close();