mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 15:54:17 +02:00
Fix encoding of nfo file cannot be changed bug
Fix #8823, fix #9153, fix #13905, close #15902
This commit is contained in:
parent
28244a5996
commit
dd0b557e14
@ -816,6 +816,9 @@ BufferID FileManager::loadFile(const wchar_t* filename, Document doc, int encodi
|
|||||||
newBuf->_timeStamp = fileNameTimestamp;
|
newBuf->_timeStamp = fileNameTimestamp;
|
||||||
|
|
||||||
// restore the encoding (ANSI based) while opening the existing file
|
// restore the encoding (ANSI based) while opening the existing file
|
||||||
|
if (newBuf->_lang == L_ASCII)
|
||||||
|
newBuf->setEncoding(NPP_CP_DOS_437);
|
||||||
|
else
|
||||||
newBuf->setEncoding(-1);
|
newBuf->setEncoding(-1);
|
||||||
|
|
||||||
// if not a large file, no file extension, and the language has been detected, we use the detected value
|
// if not a large file, no file extension, and the language has been detected, we use the detected value
|
||||||
|
@ -1861,10 +1861,9 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
|
|
||||||
Buffer* buf = MainFileManager.getBufferByID(_currentBufferID);
|
Buffer* buf = MainFileManager.getBufferByID(_currentBufferID);
|
||||||
|
|
||||||
if (buf->getEncoding() != NPP_CP_DOS_437)
|
if (buf->getEncoding() == NPP_CP_DOS_437)
|
||||||
{
|
{
|
||||||
buf->setEncoding(NPP_CP_DOS_437);
|
MainFileManager.reloadBuffer(buf);
|
||||||
::SendMessage(_hParent, WM_COMMAND, IDM_FILE_RELOAD, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user