OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../js/resources/js-test-pre.js"></script> | 3 <script src="../js/resources/js-test-pre.js"></script> |
4 <script src="resources/char-encoding-utils.js"></script> | 4 <script src="resources/char-encoding-utils.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <form id="form" method="GET" target="subframe"><input type="text" id="text" name
="text"></form> | 7 <form id="form" method="GET" target="subframe"><input type="text" id="text" name
="text"></form> |
8 <iframe id="subframe" name="subframe"></iframe> | 8 <iframe id="subframe" name="subframe"></iframe> |
9 <script> | 9 <script> |
10 | 10 |
11 | 11 |
12 var charsets = new Array; | 12 var charsets = new Array; |
13 var unicodes = new Array; | 13 var unicodes = new Array; |
14 var expectedResults = new Array; | 14 var expectedResults = new Array; |
15 | 15 |
16 var results = new Object; | 16 var results = new Object; |
17 | 17 |
18 var i = 0; | 18 var i = 0; |
19 | 19 |
| 20 |
20 testEncode("UTF-8", "U+00A0", "%C2%A0"); | 21 testEncode("UTF-8", "U+00A0", "%C2%A0"); |
| 22 |
| 23 // Unpaired UTF-16 surrogates |
| 24 testEncode("UTF-8", "0xD800", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
| 25 testEncode("UTF-8", "0xDC00", "%EF%BF%BD"); // U+FFFD (REPLACEMENT CHARACTER) |
| 26 |
21 //Yen symbol in gbk | 27 //Yen symbol in gbk |
22 testEncode('GBK', 'U+00A5', '%A3%A4'); | 28 testEncode('GBK', 'U+00A5', '%A3%A4'); |
23 testEncode('gb2312', 'U+00A5', '%A3%A4'); | 29 testEncode('gb2312', 'U+00A5', '%A3%A4'); |
24 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); | 30 testEncode('GB_2312-80', 'U+00A5', '%A3%A4'); |
25 testEncode('EUC-CN', 'U+00A5', '%A3%A4'); | 31 testEncode('EUC-CN', 'U+00A5', '%A3%A4'); |
26 //Euro symbol in gbk | 32 //Euro symbol in gbk |
27 testEncode('GBK', 'U+20AC', '%80'); | 33 testEncode('GBK', 'U+20AC', '%80'); |
28 testEncode('gb2312', 'U+20AC', '%80'); | 34 testEncode('gb2312', 'U+20AC', '%80'); |
29 testEncode('GB_2312-80', 'U+20AC', '%80'); | 35 testEncode('GB_2312-80', 'U+20AC', '%80'); |
30 testEncode('EUC-CN', 'U+20AC', '%80'); | 36 testEncode('EUC-CN', 'U+20AC', '%80'); |
31 //Misc symbols from TEC specific GBK translation | 37 //Misc symbols from TEC specific GBK translation |
32 testEncode('GBK', 'U+01F9', '%A8%BF'); | 38 testEncode('GBK', 'U+01F9', '%A8%BF'); |
33 testEncode('GBK', 'U+1E3F', '%A8%BC'); | 39 testEncode('GBK', 'U+1E3F', '%A8%BC'); |
34 testEncode('GBK', 'U+22EF', '%A1%AD'); | 40 testEncode('GBK', 'U+22EF', '%A1%AD'); |
35 testEncode('GBK', 'U+301C', '%A1%AB'); | 41 testEncode('GBK', 'U+301C', '%A1%AB'); |
36 | 42 |
37 // Turning on this test causes a download to occur. FIXME: A bug? | 43 // Turning on this test causes a download to occur. FIXME: A bug? |
38 // testEncode('UTF-8', 'U+221A', '%E2%88%9A'); | 44 // testEncode('UTF-8', 'U+221A', '%E2%88%9A'); |
39 | 45 |
40 if (window.testRunner) | 46 if (window.testRunner) |
41 testRunner.waitUntilDone(); | 47 testRunner.waitUntilDone(); |
42 runTest(); | 48 runTest(); |
43 | 49 |
44 </script> | 50 </script> |
45 </body> | 51 </body> |
46 </html> | 52 </html> |
OLD | NEW |