| OLD | NEW |
| 1 <html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <title>Character Decoding</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-decoding-utils.js"></script> | 5 <script src="resources/char-decoding-utils.js"></script> |
| 5 </head> | |
| 6 <body> | |
| 7 <script> | 6 <script> |
| 8 | 7 |
| 9 description("This tests decoding characters in various character sets."); | |
| 10 | |
| 11 testDecode('UTF-8', '%E2%88%9A', 'U+221A'); | 8 testDecode('UTF-8', '%E2%88%9A', 'U+221A'); |
| 12 | 9 |
| 13 // \xA3\xA0 in GBK should be mapped to U+3000 instead of U+E5E5. | 10 // \xA3\xA0 in GBK should be mapped to U+3000 instead of U+E5E5. |
| 14 testDecode('gb2312', '%A3%A0', 'U+3000'); | 11 testDecode('gb2312', '%A3%A0', 'U+3000'); |
| 15 testDecode('gb_2312', '%A3%A0', 'U+3000'); | 12 testDecode('gb_2312', '%A3%A0', 'U+3000'); |
| 16 testDecode('gb_2312-80', '%A3%A0', 'U+3000'); | 13 testDecode('gb_2312-80', '%A3%A0', 'U+3000'); |
| 17 testDecode('csgb2312', '%A3%A0', 'U+3000'); | 14 testDecode('csgb2312', '%A3%A0', 'U+3000'); |
| 18 testDecode('iso-ir-58', '%A3%A0', 'U+3000'); | 15 testDecode('iso-ir-58', '%A3%A0', 'U+3000'); |
| 19 testDecode('csiso58gb231280', '%A3%A0', 'U+3000'); | 16 testDecode('csiso58gb231280', '%A3%A0', 'U+3000'); |
| 20 testDecode('chinese', '%A3%A0', 'U+3000'); | 17 testDecode('chinese', '%A3%A0', 'U+3000'); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 testDecode('unicodeFFFE', '%D8%69%DE%D6', 'U+D869/U+DED6'); | 144 testDecode('unicodeFFFE', '%D8%69%DE%D6', 'U+D869/U+DED6'); |
| 148 | 145 |
| 149 // Replacement encodings should decode non-empty streams as replacement (U+FFFD)
then EOF | 146 // Replacement encodings should decode non-empty streams as replacement (U+FFFD)
then EOF |
| 150 ["csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr"] | 147 ["csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr"] |
| 151 .forEach(function(encoding) { | 148 .forEach(function(encoding) { |
| 152 testDecode(encoding, "", ""); | 149 testDecode(encoding, "", ""); |
| 153 testDecode(encoding, "%41%42%43%61%62%63%31%32%33%A0", "U+FFFD"); | 150 testDecode(encoding, "%41%42%43%61%62%63%31%32%33%A0", "U+FFFD"); |
| 154 }); | 151 }); |
| 155 | 152 |
| 156 </script> | 153 </script> |
| 157 </body> | |
| 158 </html> | |
| OLD | NEW |