OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Character Encoding</title> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
4 <script src="resources/char-encoding-utils.js"></script> | 5 <script src="resources/char-encoding-utils.js"></script> |
5 </head> | |
6 <body> | 6 <body> |
7 <form id="form" method="GET" target="subframe"><input type="text" id="text" name
="text"></form> | |
8 <iframe id="subframe" name="subframe"></iframe> | |
9 <script> | 7 <script> |
10 | 8 |
11 | |
12 var charsets = new Array; | |
13 var unicodes = new Array; | |
14 var expectedResults = new Array; | |
15 | |
16 var results = new Object; | |
17 | |
18 var i = 0; | |
19 | |
20 | |
21 testEncode("UTF-8", "U+00A0", "%C2%A0"); | 9 testEncode("UTF-8", "U+00A0", "%C2%A0"); |
| 10 testEncode('UTF-8', 'U+221A', '%E2%88%9A'); |
22 | 11 |
23 // Unpaired UTF-16 surrogates | 12 // Unpaired UTF-16 surrogates |
24 testEncode("UTF-8", "0xD800", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) | 13 testEncode("UTF-8", "0xD800", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
25 testEncode("UTF-8", "0xDC00", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) | 14 testEncode("UTF-8", "0xDC00", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
26 | 15 |
27 //Yen symbol in gbk | 16 //Yen symbol in gbk |
28 testEncode('GBK', 'U+00A5', '%A3%A4'); | 17 testEncode('GBK', 'U+00A5', '%A3%A4'); |
29 testEncode('gb2312', 'U+00A5', '%A3%A4'); | 18 testEncode('gb2312', 'U+00A5', '%A3%A4'); |
30 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); | 19 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); |
31 testEncode('EUC-CN', 'U+00A5', '%A3%A4'); | 20 testEncode('EUC-CN', 'U+00A5', '%A3%A4'); |
(...skipping 30 matching lines...) Expand all Loading... |
62 testEncode('KOI8-RU', 'U+045E', '%AE'); | 51 testEncode('KOI8-RU', 'U+045E', '%AE'); |
63 testEncode('KOI8-RU', 'U+040E', '%BE'); | 52 testEncode('KOI8-RU', 'U+040E', '%BE'); |
64 | 53 |
65 // Replacement encodings - should encode as UTF-8 | 54 // Replacement encodings - should encode as UTF-8 |
66 testEncode("csiso2022kr", "U+00A0", "%C2%A0"); | 55 testEncode("csiso2022kr", "U+00A0", "%C2%A0"); |
67 testEncode("hz-gb-2312", "U+00A0", "%C2%A0"); | 56 testEncode("hz-gb-2312", "U+00A0", "%C2%A0"); |
68 testEncode("iso-2022-cn", "U+00A0", "%C2%A0"); | 57 testEncode("iso-2022-cn", "U+00A0", "%C2%A0"); |
69 testEncode("iso-2022-cn-ext", "U+00A0", "%C2%A0"); | 58 testEncode("iso-2022-cn-ext", "U+00A0", "%C2%A0"); |
70 testEncode("iso-2022-kr", "U+00A0", "%C2%A0"); | 59 testEncode("iso-2022-kr", "U+00A0", "%C2%A0"); |
71 | 60 |
72 // Turning on this test causes a download to occur. FIXME: A bug? | |
73 // testEncode('UTF-8', 'U+221A', '%E2%88%9A'); | |
74 | |
75 if (window.testRunner) | |
76 testRunner.waitUntilDone(); | |
77 runTest(); | |
78 | |
79 </script> | 61 </script> |
80 </body> | 62 </body> |
81 </html> | |
OLD | NEW |