change to set encoding

This commit is contained in:
王劲鹏 2021-02-19 11:19:11 +08:00 committed by osborn
parent ae19dbd694
commit df8b98bc6c

View File

@ -13,7 +13,7 @@ public:
QFile *file = new QFile(resource.fileName());
file->open(QFile::ReadOnly | QFile::Text);
QTextStream in(file);
in.setAutoDetectUnicode(true);
in.setEncoding(QStringConverter::Encoding::Utf8);
QString content = in.readAll();
file->close();
delete file;