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"); |
22 | 10 |
23 // Unpaired UTF-16 surrogates | 11 // Unpaired UTF-16 surrogates |
24 testEncode("UTF-8", "0xD800", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) | 12 testEncode("UTF-8", "0xD800", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
25 testEncode("UTF-8", "0xDC00", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) | 13 testEncode("UTF-8", "0xDC00", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
26 | 14 |
27 //Yen symbol in gbk | 15 //Yen symbol in gbk |
28 testEncode('GBK', 'U+00A5', '%A3%A4'); | 16 testEncode('GBK', 'U+00A5', '%A3%A4'); |
29 testEncode('gb2312', 'U+00A5', '%A3%A4'); | 17 testEncode('gb2312', 'U+00A5', '%A3%A4'); |
30 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); | 18 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 testEncode('KOI8-RU', 'U+045E', '%AE'); | 50 testEncode('KOI8-RU', 'U+045E', '%AE'); |
63 testEncode('KOI8-RU', 'U+040E', '%BE'); | 51 testEncode('KOI8-RU', 'U+040E', '%BE'); |
64 | 52 |
65 // Replacement encodings - should encode as UTF-8 | 53 // Replacement encodings - should encode as UTF-8 |
66 testEncode("csiso2022kr", "U+00A0", "%C2%A0"); | 54 testEncode("csiso2022kr", "U+00A0", "%C2%A0"); |
67 testEncode("hz-gb-2312", "U+00A0", "%C2%A0"); | 55 testEncode("hz-gb-2312", "U+00A0", "%C2%A0"); |
68 testEncode("iso-2022-cn", "U+00A0", "%C2%A0"); | 56 testEncode("iso-2022-cn", "U+00A0", "%C2%A0"); |
69 testEncode("iso-2022-cn-ext", "U+00A0", "%C2%A0"); | 57 testEncode("iso-2022-cn-ext", "U+00A0", "%C2%A0"); |
70 testEncode("iso-2022-kr", "U+00A0", "%C2%A0"); | 58 testEncode("iso-2022-kr", "U+00A0", "%C2%A0"); |
71 | 59 |
72 // Turning on this test causes a download to occur. FIXME: A bug? | 60 // Previously caused an error. |
foolip
2016/10/04 09:35:18
This comment will probably look mysterious when up
jsbell
2016/10/04 17:41:39
Good point. Moved it up with the other UTF-8 cases
| |
73 // testEncode('UTF-8', 'U+221A', '%E2%88%9A'); | 61 testEncode('UTF-8', 'U+221A', '%E2%88%9A'); |
74 | |
75 if (window.testRunner) | |
76 testRunner.waitUntilDone(); | |
77 runTest(); | |
78 | |
79 </script> | 62 </script> |
80 </body> | 63 </body> |
81 </html> | |
OLD | NEW |