http://bugs.webkit.org/show_bug.cgi?id=11054
REGRESSION: Traditional Chinese encoding in login authentication
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.
WebCore:
* platform/StreamingTextDecoderICU.cpp:
(WebCore::TextCodecICU::registerEncodingNames):
LayoutTests:
Each of these tests is passed by Firefox 1.5 and/or WinIE 6.
* fast/encoding/GBK/EUC-CN-expected.txt: Added.
* fast/encoding/GBK/EUC-CN.html: Added.
* fast/encoding/GBK/chinese-expected.txt: Added.
* fast/encoding/GBK/chinese.html: Added.
* fast/encoding/GBK/cn-gb-expected.txt: Added.
* fast/encoding/GBK/cn-gb.html: Added.
* fast/encoding/GBK/csgb2312-expected.txt: Added.
* fast/encoding/GBK/csgb2312.html: Added.
* fast/encoding/GBK/csgb231280-expected.txt: Added.
* fast/encoding/GBK/csgb231280.html: Added.
* fast/encoding/GBK/gb2312-expected.txt: Added.
* fast/encoding/GBK/gb2312.html: Added.
* fast/encoding/GBK/gb_2312-80-expected.txt: Added.
* fast/encoding/GBK/gb_2312-80.html: Added.
* fast/encoding/GBK/gbk-expected.txt: Added.
* fast/encoding/GBK/gbk.html: Added.
* fast/encoding/GBK/iso-ir-58-expected.txt: Added.
* fast/encoding/GBK/iso-ir-58.html: Added.
* fast/encoding/GBK/x-euc-cn-expected.txt: Added.
* fast/encoding/GBK/x-euc-cn.html: Added.
* fast/encoding/GBK/x-gbk-expected.txt: Added.
* fast/encoding/GBK/x-gbk.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16807
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-05 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Darin.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11054
+ REGRESSION: Traditional Chinese encoding in login authentication
+
+ Each of these tests is passed by Firefox 1.5 and/or WinIE 6.
+
+ * fast/encoding/GBK/EUC-CN-expected.txt: Added.
+ * fast/encoding/GBK/EUC-CN.html: Added.
+ * fast/encoding/GBK/chinese-expected.txt: Added.
+ * fast/encoding/GBK/chinese.html: Added.
+ * fast/encoding/GBK/cn-gb-expected.txt: Added.
+ * fast/encoding/GBK/cn-gb.html: Added.
+ * fast/encoding/GBK/csgb2312-expected.txt: Added.
+ * fast/encoding/GBK/csgb2312.html: Added.
+ * fast/encoding/GBK/csgb231280-expected.txt: Added.
+ * fast/encoding/GBK/csgb231280.html: Added.
+ * fast/encoding/GBK/gb2312-expected.txt: Added.
+ * fast/encoding/GBK/gb2312.html: Added.
+ * fast/encoding/GBK/gb_2312-80-expected.txt: Added.
+ * fast/encoding/GBK/gb_2312-80.html: Added.
+ * fast/encoding/GBK/gbk-expected.txt: Added.
+ * fast/encoding/GBK/gbk.html: Added.
+ * fast/encoding/GBK/iso-ir-58-expected.txt: Added.
+ * fast/encoding/GBK/iso-ir-58.html: Added.
+ * fast/encoding/GBK/x-euc-cn-expected.txt: Added.
+ * fast/encoding/GBK/x-euc-cn.html: Added.
+ * fast/encoding/GBK/x-gbk-expected.txt: Added.
+ * fast/encoding/GBK/x-gbk.html: Added.
+
2006-10-04 Anders Carlsson <acarlsson@apple.com>
Reviewed by Adam.
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=EUC-CN" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=chinese" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=cn-gb" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=csgb2312" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=csgb231280" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=gb2312" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=gb_2312-80" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=gbk" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=iso-ir-58" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=x-euc-cn" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
--- /dev/null
+The following two lines should look identically:
+
+一筆€镕
+
+一筆€镕
+
+
--- /dev/null
+<head>
+ <meta content="text/html; charset=x-gbk" http-equiv="Content-Type"/>
+</head>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>The following two lines should look identically:</p>
+<p>Ò»¹P\80éF</p>
+<p>一筆€镕</p>
+2006-10-05 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Darin.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11054
+ REGRESSION: Traditional Chinese encoding in login authentication
+
+ 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.
+
+ * platform/StreamingTextDecoderICU.cpp:
+ (WebCore::TextCodecICU::registerEncodingNames):
+
2006-10-05 Eric Seidel <eric@eseidel.com>
Reviewed by mjs.
if (!U_SUCCESS(error) || !standardName)
continue;
- registrar(standardName, standardName);
+ // 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";
+ else
+ registrar(standardName, standardName);
uint16_t numAliases = ucnv_countAliases(name, &error);
ASSERT(U_SUCCESS(error));