From caee8909608fb747e9a510885ea2d4b9514f5b76 Mon Sep 17 00:00:00 2001 From: Don HO Date: Tue, 16 May 2017 19:45:56 +0200 Subject: [PATCH] Refine the empty file as UTF8 encoding feature --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 1ad384d4e..c257947e0 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -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; } }