https://git.reactos.org/?p=reactos.git;a=commitdiff;h=647b67c1acf5d86450a71777e5092bdaf0aeccd8
commit 647b67c1acf5d86450a71777e5092bdaf0aeccd8 Author: Katayama Hirofumi MZ <[email protected]> AuthorDate: Tue Feb 14 13:34:20 2023 +0900 Commit: Katayama Hirofumi MZ <[email protected]> CommitDate: Tue Feb 14 13:34:20 2023 +0900 [NOTEPAD] Optimize AnalyzeEncoding CORE-14641 --- base/applications/notepad/text.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/base/applications/notepad/text.c b/base/applications/notepad/text.c index f74fd01abd2..7f0511229a1 100644 --- a/base/applications/notepad/text.c +++ b/base/applications/notepad/text.c @@ -39,7 +39,7 @@ BOOL IsTextNonZeroASCII(const void *pText, DWORD dwSize) ENCODING AnalyzeEncoding(const char *pBytes, DWORD dwSize) { - INT flags = IS_TEXT_UNICODE_STATISTICS; + INT flags = IS_TEXT_UNICODE_STATISTICS | IS_TEXT_UNICODE_REVERSE_STATISTICS; if (dwSize <= 1 || IsTextNonZeroASCII(pBytes, dwSize)) return ENCODING_ANSI; @@ -47,8 +47,6 @@ ENCODING AnalyzeEncoding(const char *pBytes, DWORD dwSize) if (IsTextUnicode(pBytes, dwSize, &flags)) return ENCODING_UTF16LE; - flags = IS_TEXT_UNICODE_STATISTICS | IS_TEXT_UNICODE_REVERSE_STATISTICS; - IsTextUnicode(pBytes, dwSize, &flags); if (((flags & IS_TEXT_UNICODE_REVERSE_MASK) == IS_TEXT_UNICODE_REVERSE_STATISTICS)) return ENCODING_UTF16BE;
