Apply the new file custom encoding to an opened empty file

Closes #2997, fixes #2947, fixes #1874
This commit is contained in:
Richard Brock 2017-03-06 13:00:21 -05:00 committed by Don HO
parent 4c03c3eab7
commit a9de79a550

View File

@ -1467,6 +1467,11 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
NppParameters *pNppParamInst = NppParameters::getInstance();
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
eolFormat = ndds._format;
//for empty files, set the encoding to the default for new files
if (fileSize == 0)
{
encoding = ndds._unicodeMode;
}
}
else
{