diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 10c4481fc..48975cfac 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -411,7 +411,18 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc) { { buf->determinateFormat(""); } - buf->setUnicodeMode(UnicodeConvertor.getEncoding()); + + UniMode encoding = UnicodeConvertor.getEncoding(); + if (encoding == uni8Bit) + { + NppParameters *pNppParamInst = NppParameters::getInstance(); + const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); + if (ndds._encoding == uniCookie) + { + encoding = uniCookie; + } + } + buf->setUnicodeMode(encoding); //determine buffer properties BufferID retval = _nextBufferID++;