diff --git a/NEWS.md b/NEWS.md index 653d170f..ce26f9ad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,7 @@ Red Panda C++ Version 2.19 - 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. - 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 diff --git a/libs/qsynedit/qsynedit/document.cpp b/libs/qsynedit/qsynedit/document.cpp index 4cfe2091..f64546cb 100644 --- a/libs/qsynedit/qsynedit/document.cpp +++ b/libs/qsynedit/qsynedit/document.cpp @@ -778,7 +778,7 @@ void Document::saveToFile(QFile &file, const QByteArray& encoding, } if (allAscii) { realEncoding = ENCODING_ASCII; - } else if (encoding == ENCODING_AUTO_DETECT) { + } else if (realEncoding == ENCODING_SYSTEM_DEFAULT) { if (QString(codec->name()).compare("System",Qt::CaseInsensitive)==0) { realEncoding = pCharsetInfoManager->getDefaultSystemEncoding(); } else {