From fbf0ab11fe658efab639a5246ddf4d0abe1ab5e9 Mon Sep 17 00:00:00 2001 From: donho Date: Sat, 10 Jan 2009 15:22:16 +0000 Subject: [PATCH] [NEW_FEATURE] Add the ability to force opened ANSI document as UTF-8 w/o BOM. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@392 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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++;