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

Unified Diff: third_party/WebKit/WebCore/platform/text/TextCodecICU.cpp

Issue 13197: Unfork TextCodecICU.cpp. The upstream accepted my patch with some changes ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/WebCore/platform/text/TextCodecICU.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/text/TextCodecICU.cpp (revision 6434)
+++ third_party/WebKit/WebCore/platform/text/TextCodecICU.cpp (working copy)
@@ -110,17 +110,19 @@
continue;
}
- // Here, we used to alias GB2312 and GB2312-80 to GBK, but our copy
- // of ICU treats GB2312/GB2312-80 as synonyms of GBK so that we
- // don't need that any more.
+ // 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") == 0 || strcmp(standardName, "GB_2312-80") == 0)
+ standardName = "GBK";
// Similarly, EUC-KR encodings all map to an extended version.
- if (strcmp(standardName, "KSC_5601") == 0 || strcmp(standardName, "EUC-KR") == 0 || strcmp(standardName, "cp1363") == 0)
- standardName = "windows-949-2000";
+ 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") == 0) // This name is returned in different case by ICU 3.2 and 3.6.
standardName = "windows-1254";
else if (strcmp(standardName, "TIS-620") == 0)
- standardName = "windows-874-2000";
+ standardName = "windows-874";
registrar(standardName, standardName);
@@ -136,30 +138,35 @@
}
}
- // We used to map macroman and xmacroman to macintosh, but
- // we don't need them any more because they're added to our
- // local copy of ICU.
+ // Additional aliases.
+ // These are present in modern versions of ICU, but not in ICU 3.2 (shipped with Mac OS X 10.4).
+ registrar("macroman", "macintosh");
+ registrar("maccyrillic", "x-mac-cyrillic");
// Additional aliases that historically were present in the encoding
// table in WebKit on Macintosh that don't seem to be present in ICU.
// Perhaps we can prove these are not used on the web and remove them.
// Or perhaps we can get them added to ICU.
+ registrar("xmacroman", "macintosh");
+ registrar("xmacukrainian", "x-mac-cyrillic");
registrar("cnbig5", "Big5");
- registrar("cngb", "EUC-CN");
+ registrar("xxbig5", "Big5");
+ registrar("cngb", "GBK");
+ registrar("csgb231280", "GBK");
+ registrar("xeuccn", "GBK");
+ registrar("xgbk", "GBK");
registrar("csISO88598I", "ISO_8859-8-I");
- registrar("csgb231280", "EUC-CN");
- registrar("dos720", "cp864");
- registrar("dos874", "TIS-620");
- registrar("jis7", "ISO-2022-JP");
registrar("koi", "KOI8-R");
registrar("logical", "ISO-8859-8-I");
registrar("unicode11utf8", "UTF-8");
registrar("unicode20utf8", "UTF-8");
+ registrar("xunicode20utf8", "UTF-8");
registrar("visual", "ISO-8859-8");
registrar("winarabic", "windows-1256");
registrar("winbaltic", "windows-1257");
registrar("wincyrillic", "windows-1251");
- registrar("iso885911", "windows874-2000");
+ registrar("iso885911", "windows-874");
+ registrar("dos874", "windows-874");
registrar("wingreek", "windows-1253");
registrar("winhebrew", "windows-1255");
registrar("winlatin2", "windows-1250");
@@ -168,16 +175,9 @@
registrar("xcp1250", "windows-1250");
registrar("xcp1251", "windows-1251");
registrar("xeuc", "EUC-JP");
- registrar("xeuccn", "EUC-CN");
- registrar("xgbk", "EUC-CN");
- registrar("xunicode20utf8", "UTF-8");
- registrar("xwindows949", "windows-949-2000");
- registrar("xxbig5", "Big5");
+ registrar("xwindows949", "windows-949");
+ registrar("xuhc", "windows-949");
- // This alias is present in modern versions of ICU, but it has no standard name,
- // so we give one to it manually. It is not present in ICU 3.2.
- registrar("windows874", "windows874-2000");
-
// These aliases are present in modern versions of ICU, but use different codecs, and have no standard names.
// They are not present in ICU 3.2.
registrar("dos720", "cp864");
@@ -482,4 +482,3 @@
} // namespace WebCore
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698