Refine the empty file as UTF8 encoding feature

This commit is contained in:
Don HO 2017-05-16 19:45:56 +02:00
parent 8aa6562ac3
commit caee890960
1 changed files with 2 additions and 2 deletions

View File

@ -1461,10 +1461,10 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
eolFormat = ndds._format;
//for empty files, set the encoding to the default for new files
//for empty files, if the default for new files is UTF8, and "Apply to opened ANSI files" is set, apply it
if (fileSize == 0)
{
if (ndds._unicodeMode == uniCookie)
if (ndds._unicodeMode == uniCookie && ndds._openAnsiAsUtf8)
encoding = SC_CP_UTF8;
}
}