- fix: File's real encoding is not correctly calculated when save it using system default encoding.

This commit is contained in:
Roy Qu 2023-03-27 10:53:25 +08:00
parent 5f1aa5f620
commit a51ac2fb63
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ Red Panda C++ Version 2.19
- fix: "Run all problem cases" with project is not correctly handled. - fix: "Run all problem cases" with project is not correctly handled.
- fix: When adding files to project and there'are duplicates, the warning info is not complete. - fix: When adding files to project and there'are duplicates, the warning info is not complete.
- enhancement: Improve code completion suggestion for arrays. - enhancement: Improve code completion suggestion for arrays.
- fix: File's real encoding is not correctly calculated when save it using system default encoding.
Red Panda C++ Version 2.18 Red Panda C++ Version 2.18

View File

@ -778,7 +778,7 @@ void Document::saveToFile(QFile &file, const QByteArray& encoding,
} }
if (allAscii) { if (allAscii) {
realEncoding = ENCODING_ASCII; realEncoding = ENCODING_ASCII;
} else if (encoding == ENCODING_AUTO_DETECT) { } else if (realEncoding == ENCODING_SYSTEM_DEFAULT) {
if (QString(codec->name()).compare("System",Qt::CaseInsensitive)==0) { if (QString(codec->name()).compare("System",Qt::CaseInsensitive)==0) {
realEncoding = pCharsetInfoManager->getDefaultSystemEncoding(); realEncoding = pCharsetInfoManager->getDefaultSystemEncoding();
} else { } else {