From c16f0d39309ce420dcfa7cceb0f5febe1879ca19 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 8 Dec 2009 23:43:24 +0000 Subject: [PATCH] [BUG_FIXED] Fix the Unicode localization file display incident. [UPDATE] Update 3 localization files. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@588 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/installer/nativeLang/chinese.xml | 1 + PowerEditor/installer/nativeLang/english.xml | 1 + PowerEditor/installer/nativeLang/french.xml | 1 + PowerEditor/src/EncodingMapper.cpp | 3 +++ PowerEditor/src/Notepad_plus.cpp | 4 +++- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PowerEditor/installer/nativeLang/chinese.xml b/PowerEditor/installer/nativeLang/chinese.xml index b8dcdd8ca..573ee6f45 100644 --- a/PowerEditor/installer/nativeLang/chinese.xml +++ b/PowerEditor/installer/nativeLang/chinese.xml @@ -201,6 +201,7 @@ + diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 323a2bfab..525beaf6d 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -198,6 +198,7 @@ + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 1c1e0d684..c269eba07 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -196,6 +196,7 @@ + diff --git a/PowerEditor/src/EncodingMapper.cpp b/PowerEditor/src/EncodingMapper.cpp index 14acfb892..3e696863c 100644 --- a/PowerEditor/src/EncodingMapper.cpp +++ b/PowerEditor/src/EncodingMapper.cpp @@ -128,6 +128,9 @@ int EncodingMapper::getIndexFromEncoding(int encoding) const int EncodingMapper::getEncodingFromString(const char *encodingAlias) const { + if (isInListA(encodingAlias, "utf-8 utf8")) + return 65001; + size_t nbItem = sizeof(encodings)/sizeof(EncodingUnit); int enc = -1; for (size_t i = 0 ; i < nbItem ; i++) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index c244a1caa..3e8ac5b3c 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -106,7 +106,9 @@ Notepad_plus::Notepad_plus(): Window(), _mainWindowStatus(0), _pDocTab(NULL), _p { const char * encodingStr = declaration->Encoding(); EncodingMapper *em = EncodingMapper::getInstance(); - _nativeLangEncoding = em->getEncodingFromString(encodingStr); + int enc = em->getEncodingFromString(encodingStr); + if (enc != -1) + _nativeLangEncoding = enc; } } }