Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: trunk/Source/wtf/text/TextCodecICU.cpp

Issue 26184004: Revert 158972 "Canonical name change: windows-949 => EUC-KR" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/core/inspector/InspectorFileSystemAgent.cpp ('k') | trunk/Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/wtf/text/TextCodecICU.cpp
===================================================================
--- trunk/Source/wtf/text/TextCodecICU.cpp (revision 159022)
+++ trunk/Source/wtf/text/TextCodecICU.cpp (working copy)
@@ -84,22 +84,18 @@
continue;
}
- // A number of these aliases are handled in Chrome's copy of ICU, but
- // Chromium can be compiled with the system ICU.
-
// 1. Treat GB2312 encoding as GBK (its more modern superset), to match other browsers.
// 2. On the Web, GB2312 is encoded as EUC-CN or HZ, while ICU provides a native encoding
// for encoding GB_2312-80 and several others. So, we need to override this behavior, too.
- if (!strcmp(standardName, "GB2312") || !strcmp(standardName, "GB_2312-80"))
+ if (strcmp(standardName, "GB2312") == 0 || strcmp(standardName, "GB_2312-80") == 0)
standardName = "GBK";
- // Similarly, EUC-KR encodings all map to an extended version, but
- // per HTML5, the canonical name still should be EUC-KR.
- else if (!strcmp(standardName, "EUC-KR") || !strcmp(standardName, "KSC_5601") || !strcmp(standardName, "cp1363"))
- standardName = "EUC-KR";
+ // Similarly, EUC-KR encodings all map to an extended version.
+ else if (strcmp(standardName, "KSC_5601") == 0 || strcmp(standardName, "EUC-KR") == 0 || strcmp(standardName, "cp1363") == 0)
+ standardName = "windows-949";
// And so on.
- else if (!strcasecmp(standardName, "iso-8859-9")) // This name is returned in different case by ICU 3.2 and 3.6.
+ else if (strcasecmp(standardName, "iso-8859-9") == 0) // This name is returned in different case by ICU 3.2 and 3.6.
standardName = "windows-1254";
- else if (!strcmp(standardName, "TIS-620"))
+ else if (strcmp(standardName, "TIS-620") == 0)
standardName = "windows-874";
registrar(standardName, standardName);
@@ -151,9 +147,9 @@
registrar("x-cp1250", "windows-1250");
registrar("x-cp1251", "windows-1251");
registrar("x-euc", "EUC-JP");
- registrar("x-windows-949", "EUC-KR");
- registrar("KSC5601", "EUC-KR");
- registrar("x-uhc", "EUC-KR");
+ registrar("x-windows-949", "windows-949");
+ registrar("KSC5601", "KSC_5601");
+ registrar("x-uhc", "windows-949");
registrar("shift-jis", "Shift_JIS");
// These aliases are present in modern versions of ICU, but use different codecs, and have no standard names.
@@ -337,7 +333,7 @@
// <http://bugs.webkit.org/show_bug.cgi?id=17014>
// Simplified Chinese pages use the code A3A0 to mean "full-width space", but ICU decodes it as U+E5E5.
- if (!strcmp(m_encoding.name(), "GBK") || !strcasecmp(m_encoding.name(), "gb18030"))
+ if (strcmp(m_encoding.name(), "GBK") == 0 || strcasecmp(m_encoding.name(), "gb18030") == 0)
resultString.replace(0xE5E5, ideographicSpace);
return resultString;
« no previous file with comments | « trunk/Source/core/inspector/InspectorFileSystemAgent.cpp ('k') | trunk/Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698