Fix accented characters not found in "find in files" issues

Fix accented characters in ANSI files not found in "find in files" and "replace in files" commands issues.
This regression (in v7.7 from v7.6.6) is due to the upgrade of Scintilla from v3.56 to v4.14.

Fix #5825, fix #5830, fix #7668, fix #7773
pull/8452/head
Don HO 5 years ago
parent f7efc2abc0
commit c5a0ed7c1a
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

@ -1749,8 +1749,14 @@ bool Notepad_plus::findInFiles()
{
Buffer * pBuf = MainFileManager.getBufferByID(id);
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, pBuf->getDocument());
auto cp = _invisibleEditView.execute(SCI_GETCODEPAGE);
_invisibleEditView.execute(SCI_SETCODEPAGE, pBuf->getUnicodeMode() == uni8Bit ? cp : SC_CP_UTF8);
auto detectedCp = _invisibleEditView.execute(SCI_GETCODEPAGE);
int cp2set = SC_CP_UTF8;
if (pBuf->getUnicodeMode() == uni8Bit)
{
cp2set = (detectedCp == SC_CP_UTF8 ? CP_ACP : detectedCp);
}
_invisibleEditView.execute(SCI_SETCODEPAGE, cp2set);
FindersInfo findersInfo;
findersInfo._pFileName = fileNames.at(i).c_str();
nbTotal += _findReplaceDlg.processAll(ProcessFindAll, FindReplaceDlg::_env, isEntireDoc, &findersInfo);

Loading…
Cancel
Save