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()); QFile *file = new QFile(resource.fileName());
file->open(QFile::ReadOnly | QFile::Text); file->open(QFile::ReadOnly | QFile::Text);
QTextStream in(file); QTextStream in(file);
in.setAutoDetectUnicode(true); in.setEncoding(QStringConverter::Encoding::Utf8);
QString content = in.readAll(); QString content = in.readAll();
file->close(); file->close();
delete file; delete file;