Browse Source

[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
pull/343/head^2
donho 16 years ago
parent
commit
fbf0ab11fe
  1. 13
      PowerEditor/src/ScitillaComponent/Buffer.cpp

13
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++;

Loading…
Cancel
Save