Recently, I found some trivial bug in Notepad++ 4.1.2.
This bug is related with encoding option.
I think that this bug is critical in the country which uses 2-byte character.
#1. Wrong encoding option is applied to the document when you change encoding option. Change encoding from ANSI to UTF-8, and then revert it(UTF-8 to ANSI). Now you can see the document is setted wrong codepage. You can solve this problem to change following source code.
Notepad_plus.cpp 2723 line
_pEditView->execute(SCI_SETCODEPAGE, isUnicodeMode?SC_CP_UTF8:_pEditView->getCodpage());
#2. Wrong encoding option is applied to the first created document after running Notepad++ when unicode encoding(UTF-8, UCS2, UCS4) is default encoding option. You can solve this problem to change following source code.
ScintillaEditView.cpp 513 line
if (isCJK())
{
if (getCurrentBuffer()._unicodeMode == uni8Bit)
execute(SCI_SETCODEPAGE, _codepage);
else
execute(SCI_SETCODEPAGE, SC_CP_UTF8);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Recently, I found some trivial bug in Notepad++ 4.1.2.
This bug is related with encoding option.
I think that this bug is critical in the country which uses 2-byte character.
#1. Wrong encoding option is applied to the document when you change encoding option. Change encoding from ANSI to UTF-8, and then revert it(UTF-8 to ANSI). Now you can see the document is setted wrong codepage. You can solve this problem to change following source code.
Notepad_plus.cpp 2723 line
_pEditView->execute(SCI_SETCODEPAGE, isUnicodeMode?SC_CP_UTF8:_pEditView->getCodpage());
#2. Wrong encoding option is applied to the first created document after running Notepad++ when unicode encoding(UTF-8, UCS2, UCS4) is default encoding option. You can solve this problem to change following source code.
ScintillaEditView.cpp 513 line
if (isCJK())
{
if (getCurrentBuffer()._unicodeMode == uni8Bit)
execute(SCI_SETCODEPAGE, _codepage);
else
execute(SCI_SETCODEPAGE, SC_CP_UTF8);
}
Nice catch. You should post a bug report with your findings. --Joel