[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 967ddc39e0
commit fbf0ab11fe

@ -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