OLD | NEW |
1 Test the Encoding API's use of encoding names | 1 This is a testharness.js-based test. |
| 2 PASS Labels for: utf-8 |
| 3 PASS Labels for: iso-8859-2 |
| 4 PASS Labels for: iso-8859-3 |
| 5 PASS Labels for: iso-8859-4 |
| 6 PASS Labels for: iso-8859-5 |
| 7 PASS Labels for: iso-8859-6 |
| 8 PASS Labels for: iso-8859-7 |
| 9 PASS Labels for: iso-8859-8 |
| 10 PASS Labels for: iso-8859-8-i |
| 11 PASS Labels for: iso-8859-10 |
| 12 PASS Labels for: iso-8859-13 |
| 13 PASS Labels for: iso-8859-14 |
| 14 PASS Labels for: iso-8859-15 |
| 15 PASS Labels for: iso-8859-16 |
| 16 PASS Labels for: koi8-r |
| 17 PASS Labels for: koi8-u |
| 18 PASS Labels for: macintosh |
| 19 PASS Labels for: windows-874 |
| 20 PASS Labels for: windows-1250 |
| 21 PASS Labels for: windows-1251 |
| 22 PASS Labels for: windows-1252 |
| 23 PASS Labels for: windows-1253 |
| 24 PASS Labels for: windows-1254 |
| 25 PASS Labels for: windows-1255 |
| 26 PASS Labels for: windows-1256 |
| 27 PASS Labels for: windows-1257 |
| 28 PASS Labels for: windows-1258 |
| 29 PASS Labels for: x-mac-cyrillic |
| 30 PASS Labels for: gbk |
| 31 PASS Labels for: gb18030 |
| 32 PASS Labels for: hz-gb-2312 |
| 33 FAIL Labels for: big5 assert_equals: expected "big5" but got "big5-hkscs" |
| 34 PASS Labels for: euc-jp |
| 35 PASS Labels for: iso-2022-jp |
| 36 PASS Labels for: shift_jis |
| 37 PASS Labels for: euc-kr |
| 38 PASS Labels for: iso-2022-kr |
| 39 FAIL Labels for: replacement assert_equals: expected "replacement" but got "iso-
2022-cn" |
| 40 PASS Labels for: utf-16be |
| 41 PASS Labels for: utf-16le |
| 42 PASS Labels for: x-user-defined |
| 43 Harness: the test ran to completion. |
2 | 44 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 name = "utf-8" | |
8 PASS new TextDecoder("unicode-1-1-utf-8").encoding is "utf-8" | |
9 PASS new TextDecoder("utf-8").encoding is "utf-8" | |
10 PASS new TextDecoder("utf8").encoding is "utf-8" | |
11 | |
12 name = "ibm866" | |
13 FAIL new TextDecoder("866").encoding should be ibm866. Threw exception TypeError
: Failed to construct 'TextDecoder': The encoding label provided ('866') is inva
lid. | |
14 FAIL new TextDecoder("cp866").encoding should be ibm866. Threw exception TypeErr
or: Failed to construct 'TextDecoder': The encoding label provided ('cp866') is
invalid. | |
15 FAIL new TextDecoder("csibm866").encoding should be ibm866. Threw exception Type
Error: Failed to construct 'TextDecoder': The encoding label provided ('csibm866
') is invalid. | |
16 FAIL new TextDecoder("ibm866").encoding should be ibm866. Threw exception TypeEr
ror: Failed to construct 'TextDecoder': The encoding label provided ('ibm866') i
s invalid. | |
17 | |
18 name = "iso-8859-2" | |
19 PASS new TextDecoder("csisolatin2").encoding is "iso-8859-2" | |
20 PASS new TextDecoder("iso-8859-2").encoding is "iso-8859-2" | |
21 PASS new TextDecoder("iso-ir-101").encoding is "iso-8859-2" | |
22 PASS new TextDecoder("iso8859-2").encoding is "iso-8859-2" | |
23 PASS new TextDecoder("iso88592").encoding is "iso-8859-2" | |
24 PASS new TextDecoder("iso_8859-2").encoding is "iso-8859-2" | |
25 PASS new TextDecoder("iso_8859-2:1987").encoding is "iso-8859-2" | |
26 PASS new TextDecoder("l2").encoding is "iso-8859-2" | |
27 PASS new TextDecoder("latin2").encoding is "iso-8859-2" | |
28 | |
29 name = "iso-8859-3" | |
30 PASS new TextDecoder("csisolatin3").encoding is "iso-8859-3" | |
31 PASS new TextDecoder("iso-8859-3").encoding is "iso-8859-3" | |
32 PASS new TextDecoder("iso-ir-109").encoding is "iso-8859-3" | |
33 PASS new TextDecoder("iso8859-3").encoding is "iso-8859-3" | |
34 PASS new TextDecoder("iso88593").encoding is "iso-8859-3" | |
35 PASS new TextDecoder("iso_8859-3").encoding is "iso-8859-3" | |
36 PASS new TextDecoder("iso_8859-3:1988").encoding is "iso-8859-3" | |
37 PASS new TextDecoder("l3").encoding is "iso-8859-3" | |
38 PASS new TextDecoder("latin3").encoding is "iso-8859-3" | |
39 | |
40 name = "iso-8859-4" | |
41 PASS new TextDecoder("csisolatin4").encoding is "iso-8859-4" | |
42 PASS new TextDecoder("iso-8859-4").encoding is "iso-8859-4" | |
43 PASS new TextDecoder("iso-ir-110").encoding is "iso-8859-4" | |
44 PASS new TextDecoder("iso8859-4").encoding is "iso-8859-4" | |
45 PASS new TextDecoder("iso88594").encoding is "iso-8859-4" | |
46 PASS new TextDecoder("iso_8859-4").encoding is "iso-8859-4" | |
47 PASS new TextDecoder("iso_8859-4:1988").encoding is "iso-8859-4" | |
48 PASS new TextDecoder("l4").encoding is "iso-8859-4" | |
49 PASS new TextDecoder("latin4").encoding is "iso-8859-4" | |
50 | |
51 name = "iso-8859-5" | |
52 PASS new TextDecoder("csisolatincyrillic").encoding is "iso-8859-5" | |
53 PASS new TextDecoder("cyrillic").encoding is "iso-8859-5" | |
54 PASS new TextDecoder("iso-8859-5").encoding is "iso-8859-5" | |
55 PASS new TextDecoder("iso-ir-144").encoding is "iso-8859-5" | |
56 PASS new TextDecoder("iso8859-5").encoding is "iso-8859-5" | |
57 PASS new TextDecoder("iso88595").encoding is "iso-8859-5" | |
58 PASS new TextDecoder("iso_8859-5").encoding is "iso-8859-5" | |
59 PASS new TextDecoder("iso_8859-5:1988").encoding is "iso-8859-5" | |
60 | |
61 name = "iso-8859-6" | |
62 PASS new TextDecoder("arabic").encoding is "iso-8859-6" | |
63 PASS new TextDecoder("asmo-708").encoding is "iso-8859-6" | |
64 PASS new TextDecoder("csiso88596e").encoding is "iso-8859-6" | |
65 PASS new TextDecoder("csiso88596i").encoding is "iso-8859-6" | |
66 PASS new TextDecoder("csisolatinarabic").encoding is "iso-8859-6" | |
67 PASS new TextDecoder("ecma-114").encoding is "iso-8859-6" | |
68 PASS new TextDecoder("iso-8859-6").encoding is "iso-8859-6" | |
69 PASS new TextDecoder("iso-8859-6-e").encoding is "iso-8859-6" | |
70 PASS new TextDecoder("iso-8859-6-i").encoding is "iso-8859-6" | |
71 PASS new TextDecoder("iso-ir-127").encoding is "iso-8859-6" | |
72 PASS new TextDecoder("iso8859-6").encoding is "iso-8859-6" | |
73 PASS new TextDecoder("iso88596").encoding is "iso-8859-6" | |
74 PASS new TextDecoder("iso_8859-6").encoding is "iso-8859-6" | |
75 PASS new TextDecoder("iso_8859-6:1987").encoding is "iso-8859-6" | |
76 | |
77 name = "iso-8859-7" | |
78 PASS new TextDecoder("csisolatingreek").encoding is "iso-8859-7" | |
79 PASS new TextDecoder("ecma-118").encoding is "iso-8859-7" | |
80 PASS new TextDecoder("elot_928").encoding is "iso-8859-7" | |
81 PASS new TextDecoder("greek").encoding is "iso-8859-7" | |
82 PASS new TextDecoder("greek8").encoding is "iso-8859-7" | |
83 PASS new TextDecoder("iso-8859-7").encoding is "iso-8859-7" | |
84 PASS new TextDecoder("iso-ir-126").encoding is "iso-8859-7" | |
85 PASS new TextDecoder("iso8859-7").encoding is "iso-8859-7" | |
86 PASS new TextDecoder("iso88597").encoding is "iso-8859-7" | |
87 PASS new TextDecoder("iso_8859-7").encoding is "iso-8859-7" | |
88 PASS new TextDecoder("iso_8859-7:1987").encoding is "iso-8859-7" | |
89 PASS new TextDecoder("sun_eu_greek").encoding is "iso-8859-7" | |
90 | |
91 name = "iso-8859-8" | |
92 PASS new TextDecoder("csiso88598e").encoding is "iso-8859-8" | |
93 PASS new TextDecoder("csisolatinhebrew").encoding is "iso-8859-8" | |
94 PASS new TextDecoder("hebrew").encoding is "iso-8859-8" | |
95 PASS new TextDecoder("iso-8859-8").encoding is "iso-8859-8" | |
96 PASS new TextDecoder("iso-8859-8-e").encoding is "iso-8859-8" | |
97 PASS new TextDecoder("iso-ir-138").encoding is "iso-8859-8" | |
98 PASS new TextDecoder("iso8859-8").encoding is "iso-8859-8" | |
99 PASS new TextDecoder("iso88598").encoding is "iso-8859-8" | |
100 PASS new TextDecoder("iso_8859-8").encoding is "iso-8859-8" | |
101 PASS new TextDecoder("iso_8859-8:1988").encoding is "iso-8859-8" | |
102 PASS new TextDecoder("visual").encoding is "iso-8859-8" | |
103 | |
104 name = "iso-8859-8-i" | |
105 PASS new TextDecoder("csiso88598i").encoding is "iso-8859-8-i" | |
106 PASS new TextDecoder("iso-8859-8-i").encoding is "iso-8859-8-i" | |
107 PASS new TextDecoder("logical").encoding is "iso-8859-8-i" | |
108 | |
109 name = "iso-8859-10" | |
110 PASS new TextDecoder("csisolatin6").encoding is "iso-8859-10" | |
111 PASS new TextDecoder("iso-8859-10").encoding is "iso-8859-10" | |
112 PASS new TextDecoder("iso-ir-157").encoding is "iso-8859-10" | |
113 PASS new TextDecoder("iso8859-10").encoding is "iso-8859-10" | |
114 PASS new TextDecoder("iso885910").encoding is "iso-8859-10" | |
115 PASS new TextDecoder("l6").encoding is "iso-8859-10" | |
116 PASS new TextDecoder("latin6").encoding is "iso-8859-10" | |
117 | |
118 name = "iso-8859-13" | |
119 PASS new TextDecoder("iso-8859-13").encoding is "iso-8859-13" | |
120 PASS new TextDecoder("iso8859-13").encoding is "iso-8859-13" | |
121 PASS new TextDecoder("iso885913").encoding is "iso-8859-13" | |
122 | |
123 name = "iso-8859-14" | |
124 PASS new TextDecoder("iso-8859-14").encoding is "iso-8859-14" | |
125 PASS new TextDecoder("iso8859-14").encoding is "iso-8859-14" | |
126 PASS new TextDecoder("iso885914").encoding is "iso-8859-14" | |
127 | |
128 name = "iso-8859-15" | |
129 PASS new TextDecoder("csisolatin9").encoding is "iso-8859-15" | |
130 PASS new TextDecoder("iso-8859-15").encoding is "iso-8859-15" | |
131 PASS new TextDecoder("iso8859-15").encoding is "iso-8859-15" | |
132 PASS new TextDecoder("iso885915").encoding is "iso-8859-15" | |
133 PASS new TextDecoder("iso_8859-15").encoding is "iso-8859-15" | |
134 PASS new TextDecoder("l9").encoding is "iso-8859-15" | |
135 | |
136 name = "iso-8859-16" | |
137 PASS new TextDecoder("iso-8859-16").encoding is "iso-8859-16" | |
138 | |
139 name = "koi8-r" | |
140 PASS new TextDecoder("cskoi8r").encoding is "koi8-r" | |
141 PASS new TextDecoder("koi").encoding is "koi8-r" | |
142 PASS new TextDecoder("koi8").encoding is "koi8-r" | |
143 PASS new TextDecoder("koi8-r").encoding is "koi8-r" | |
144 PASS new TextDecoder("koi8_r").encoding is "koi8-r" | |
145 | |
146 name = "koi8-u" | |
147 PASS new TextDecoder("koi8-u").encoding is "koi8-u" | |
148 | |
149 name = "macintosh" | |
150 PASS new TextDecoder("csmacintosh").encoding is "macintosh" | |
151 PASS new TextDecoder("mac").encoding is "macintosh" | |
152 PASS new TextDecoder("macintosh").encoding is "macintosh" | |
153 PASS new TextDecoder("x-mac-roman").encoding is "macintosh" | |
154 | |
155 name = "windows-874" | |
156 PASS new TextDecoder("dos-874").encoding is "windows-874" | |
157 PASS new TextDecoder("iso-8859-11").encoding is "windows-874" | |
158 PASS new TextDecoder("iso8859-11").encoding is "windows-874" | |
159 PASS new TextDecoder("iso885911").encoding is "windows-874" | |
160 PASS new TextDecoder("tis-620").encoding is "windows-874" | |
161 PASS new TextDecoder("windows-874").encoding is "windows-874" | |
162 | |
163 name = "windows-1250" | |
164 PASS new TextDecoder("cp1250").encoding is "windows-1250" | |
165 PASS new TextDecoder("windows-1250").encoding is "windows-1250" | |
166 PASS new TextDecoder("x-cp1250").encoding is "windows-1250" | |
167 | |
168 name = "windows-1251" | |
169 PASS new TextDecoder("cp1251").encoding is "windows-1251" | |
170 PASS new TextDecoder("windows-1251").encoding is "windows-1251" | |
171 PASS new TextDecoder("x-cp1251").encoding is "windows-1251" | |
172 | |
173 name = "windows-1252" | |
174 PASS new TextDecoder("ansi_x3.4-1968").encoding is "windows-1252" | |
175 PASS new TextDecoder("ascii").encoding is "windows-1252" | |
176 PASS new TextDecoder("cp1252").encoding is "windows-1252" | |
177 PASS new TextDecoder("cp819").encoding is "windows-1252" | |
178 PASS new TextDecoder("csisolatin1").encoding is "windows-1252" | |
179 PASS new TextDecoder("ibm819").encoding is "windows-1252" | |
180 PASS new TextDecoder("iso-8859-1").encoding is "windows-1252" | |
181 PASS new TextDecoder("iso-ir-100").encoding is "windows-1252" | |
182 PASS new TextDecoder("iso8859-1").encoding is "windows-1252" | |
183 PASS new TextDecoder("iso88591").encoding is "windows-1252" | |
184 PASS new TextDecoder("iso_8859-1").encoding is "windows-1252" | |
185 PASS new TextDecoder("iso_8859-1:1987").encoding is "windows-1252" | |
186 PASS new TextDecoder("l1").encoding is "windows-1252" | |
187 PASS new TextDecoder("latin1").encoding is "windows-1252" | |
188 PASS new TextDecoder("us-ascii").encoding is "windows-1252" | |
189 PASS new TextDecoder("windows-1252").encoding is "windows-1252" | |
190 PASS new TextDecoder("x-cp1252").encoding is "windows-1252" | |
191 | |
192 name = "windows-1253" | |
193 PASS new TextDecoder("cp1253").encoding is "windows-1253" | |
194 PASS new TextDecoder("windows-1253").encoding is "windows-1253" | |
195 PASS new TextDecoder("x-cp1253").encoding is "windows-1253" | |
196 | |
197 name = "windows-1254" | |
198 PASS new TextDecoder("cp1254").encoding is "windows-1254" | |
199 PASS new TextDecoder("csisolatin5").encoding is "windows-1254" | |
200 PASS new TextDecoder("iso-8859-9").encoding is "windows-1254" | |
201 PASS new TextDecoder("iso-ir-148").encoding is "windows-1254" | |
202 PASS new TextDecoder("iso8859-9").encoding is "windows-1254" | |
203 PASS new TextDecoder("iso88599").encoding is "windows-1254" | |
204 PASS new TextDecoder("iso_8859-9").encoding is "windows-1254" | |
205 PASS new TextDecoder("iso_8859-9:1989").encoding is "windows-1254" | |
206 PASS new TextDecoder("l5").encoding is "windows-1254" | |
207 PASS new TextDecoder("latin5").encoding is "windows-1254" | |
208 PASS new TextDecoder("windows-1254").encoding is "windows-1254" | |
209 PASS new TextDecoder("x-cp1254").encoding is "windows-1254" | |
210 | |
211 name = "windows-1255" | |
212 PASS new TextDecoder("cp1255").encoding is "windows-1255" | |
213 PASS new TextDecoder("windows-1255").encoding is "windows-1255" | |
214 PASS new TextDecoder("x-cp1255").encoding is "windows-1255" | |
215 | |
216 name = "windows-1256" | |
217 PASS new TextDecoder("cp1256").encoding is "windows-1256" | |
218 PASS new TextDecoder("windows-1256").encoding is "windows-1256" | |
219 PASS new TextDecoder("x-cp1256").encoding is "windows-1256" | |
220 | |
221 name = "windows-1257" | |
222 PASS new TextDecoder("cp1257").encoding is "windows-1257" | |
223 PASS new TextDecoder("windows-1257").encoding is "windows-1257" | |
224 PASS new TextDecoder("x-cp1257").encoding is "windows-1257" | |
225 | |
226 name = "windows-1258" | |
227 PASS new TextDecoder("cp1258").encoding is "windows-1258" | |
228 PASS new TextDecoder("windows-1258").encoding is "windows-1258" | |
229 PASS new TextDecoder("x-cp1258").encoding is "windows-1258" | |
230 | |
231 name = "x-mac-cyrillic" | |
232 PASS new TextDecoder("x-mac-cyrillic").encoding is "x-mac-cyrillic" | |
233 PASS new TextDecoder("x-mac-ukrainian").encoding is "x-mac-cyrillic" | |
234 | |
235 name = "gbk" | |
236 PASS new TextDecoder("chinese").encoding is "gbk" | |
237 PASS new TextDecoder("csgb2312").encoding is "gbk" | |
238 PASS new TextDecoder("csiso58gb231280").encoding is "gbk" | |
239 PASS new TextDecoder("gb2312").encoding is "gbk" | |
240 PASS new TextDecoder("gb_2312").encoding is "gbk" | |
241 PASS new TextDecoder("gb_2312-80").encoding is "gbk" | |
242 PASS new TextDecoder("gbk").encoding is "gbk" | |
243 PASS new TextDecoder("iso-ir-58").encoding is "gbk" | |
244 PASS new TextDecoder("x-gbk").encoding is "gbk" | |
245 | |
246 name = "gb18030" | |
247 PASS new TextDecoder("gb18030").encoding is "gb18030" | |
248 | |
249 name = "hz-gb-2312" | |
250 PASS new TextDecoder("hz-gb-2312").encoding is "hz-gb-2312" | |
251 | |
252 name = "big5" | |
253 PASS new TextDecoder("big5").encoding is "big5" | |
254 FAIL new TextDecoder("big5-hkscs").encoding should be big5. Was big5-hkscs. | |
255 PASS new TextDecoder("cn-big5").encoding is "big5" | |
256 PASS new TextDecoder("csbig5").encoding is "big5" | |
257 PASS new TextDecoder("x-x-big5").encoding is "big5" | |
258 | |
259 name = "euc-jp" | |
260 PASS new TextDecoder("cseucpkdfmtjapanese").encoding is "euc-jp" | |
261 PASS new TextDecoder("euc-jp").encoding is "euc-jp" | |
262 PASS new TextDecoder("x-euc-jp").encoding is "euc-jp" | |
263 | |
264 name = "iso-2022-jp" | |
265 PASS new TextDecoder("csiso2022jp").encoding is "iso-2022-jp" | |
266 PASS new TextDecoder("iso-2022-jp").encoding is "iso-2022-jp" | |
267 | |
268 name = "shift_jis" | |
269 PASS new TextDecoder("csshiftjis").encoding is "shift_jis" | |
270 PASS new TextDecoder("ms_kanji").encoding is "shift_jis" | |
271 PASS new TextDecoder("shift-jis").encoding is "shift_jis" | |
272 PASS new TextDecoder("shift_jis").encoding is "shift_jis" | |
273 PASS new TextDecoder("sjis").encoding is "shift_jis" | |
274 PASS new TextDecoder("windows-31j").encoding is "shift_jis" | |
275 PASS new TextDecoder("x-sjis").encoding is "shift_jis" | |
276 | |
277 name = "euc-kr" | |
278 PASS new TextDecoder("cseuckr").encoding is "euc-kr" | |
279 PASS new TextDecoder("csksc56011987").encoding is "euc-kr" | |
280 PASS new TextDecoder("euc-kr").encoding is "euc-kr" | |
281 PASS new TextDecoder("iso-ir-149").encoding is "euc-kr" | |
282 PASS new TextDecoder("korean").encoding is "euc-kr" | |
283 PASS new TextDecoder("ks_c_5601-1987").encoding is "euc-kr" | |
284 PASS new TextDecoder("ks_c_5601-1989").encoding is "euc-kr" | |
285 PASS new TextDecoder("ksc5601").encoding is "euc-kr" | |
286 PASS new TextDecoder("ksc_5601").encoding is "euc-kr" | |
287 PASS new TextDecoder("windows-949").encoding is "euc-kr" | |
288 | |
289 name = "iso-2022-kr" | |
290 PASS new TextDecoder("csiso2022kr").encoding is "iso-2022-kr" | |
291 PASS new TextDecoder("iso-2022-kr").encoding is "iso-2022-kr" | |
292 | |
293 name = "replacement" | |
294 FAIL new TextDecoder("iso-2022-cn").encoding should be replacement. Was iso-2022
-cn. | |
295 FAIL new TextDecoder("iso-2022-cn-ext").encoding should be replacement. Was iso-
2022-cn-ext. | |
296 | |
297 name = "utf-16be" | |
298 PASS new TextDecoder("utf-16be").encoding is "utf-16be" | |
299 | |
300 name = "utf-16le" | |
301 PASS new TextDecoder("utf-16").encoding is "utf-16le" | |
302 PASS new TextDecoder("utf-16le").encoding is "utf-16le" | |
303 | |
304 name = "x-user-defined" | |
305 PASS new TextDecoder("x-user-defined").encoding is "x-user-defined" | |
306 PASS successfullyParsed is true | |
307 | |
308 TEST COMPLETE | |
309 | |
OLD | NEW |