fix: can't convert encoding

This commit is contained in:
Roy Qu 2022-04-13 23:15:31 +08:00
parent 85026ad5bf
commit 8c99d28307
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ void Editor::loadFile(QString filename) {
void Editor::saveFile(QString filename) {
QFile file(filename);
QByteArray encoding = mFileEncoding;
if (mFileEncoding==ENCODING_ASCII)
if (mEncodingOption!=ENCODING_AUTO_DETECT || mFileEncoding==ENCODING_ASCII)
encoding = mEncodingOption;
this->lines()->saveToFile(file,encoding,
pSettings->editor().defaultEncoding(),