• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Based on https://encoding.spec.whatwg.org/
2var utf_encodings = ['utf-8', 'utf-16le', 'utf-16be'];
3
4// Straight from https://encoding.spec.whatwg.org/encodings.json
5var encodings_table =
6[
7  {
8    "encodings": [
9      {
10        "labels": [
11          "unicode-1-1-utf-8",
12          "utf-8",
13          "utf8"
14        ],
15        "name": "UTF-8"
16      }
17    ],
18    "heading": "The Encoding"
19  },
20  {
21    "encodings": [
22      {
23        "labels": [
24          "866",
25          "cp866",
26          "csibm866",
27          "ibm866"
28        ],
29        "name": "IBM866"
30      },
31      {
32        "labels": [
33          "csisolatin2",
34          "iso-8859-2",
35          "iso-ir-101",
36          "iso8859-2",
37          "iso88592",
38          "iso_8859-2",
39          "iso_8859-2:1987",
40          "l2",
41          "latin2"
42        ],
43        "name": "ISO-8859-2"
44      },
45      {
46        "labels": [
47          "csisolatin3",
48          "iso-8859-3",
49          "iso-ir-109",
50          "iso8859-3",
51          "iso88593",
52          "iso_8859-3",
53          "iso_8859-3:1988",
54          "l3",
55          "latin3"
56        ],
57        "name": "ISO-8859-3"
58      },
59      {
60        "labels": [
61          "csisolatin4",
62          "iso-8859-4",
63          "iso-ir-110",
64          "iso8859-4",
65          "iso88594",
66          "iso_8859-4",
67          "iso_8859-4:1988",
68          "l4",
69          "latin4"
70        ],
71        "name": "ISO-8859-4"
72      },
73      {
74        "labels": [
75          "csisolatincyrillic",
76          "cyrillic",
77          "iso-8859-5",
78          "iso-ir-144",
79          "iso8859-5",
80          "iso88595",
81          "iso_8859-5",
82          "iso_8859-5:1988"
83        ],
84        "name": "ISO-8859-5"
85      },
86      {
87        "labels": [
88          "arabic",
89          "asmo-708",
90          "csiso88596e",
91          "csiso88596i",
92          "csisolatinarabic",
93          "ecma-114",
94          "iso-8859-6",
95          "iso-8859-6-e",
96          "iso-8859-6-i",
97          "iso-ir-127",
98          "iso8859-6",
99          "iso88596",
100          "iso_8859-6",
101          "iso_8859-6:1987"
102        ],
103        "name": "ISO-8859-6"
104      },
105      {
106        "labels": [
107          "csisolatingreek",
108          "ecma-118",
109          "elot_928",
110          "greek",
111          "greek8",
112          "iso-8859-7",
113          "iso-ir-126",
114          "iso8859-7",
115          "iso88597",
116          "iso_8859-7",
117          "iso_8859-7:1987",
118          "sun_eu_greek"
119        ],
120        "name": "ISO-8859-7"
121      },
122      {
123        "labels": [
124          "csiso88598e",
125          "csisolatinhebrew",
126          "hebrew",
127          "iso-8859-8",
128          "iso-8859-8-e",
129          "iso-ir-138",
130          "iso8859-8",
131          "iso88598",
132          "iso_8859-8",
133          "iso_8859-8:1988",
134          "visual"
135        ],
136        "name": "ISO-8859-8"
137      },
138      {
139        "labels": [
140          "csiso88598i",
141          "iso-8859-8-i",
142          "logical"
143        ],
144        "name": "ISO-8859-8-I"
145      },
146      {
147        "labels": [
148          "csisolatin6",
149          "iso-8859-10",
150          "iso-ir-157",
151          "iso8859-10",
152          "iso885910",
153          "l6",
154          "latin6"
155        ],
156        "name": "ISO-8859-10"
157      },
158      {
159        "labels": [
160          "iso-8859-13",
161          "iso8859-13",
162          "iso885913"
163        ],
164        "name": "ISO-8859-13"
165      },
166      {
167        "labels": [
168          "iso-8859-14",
169          "iso8859-14",
170          "iso885914"
171        ],
172        "name": "ISO-8859-14"
173      },
174      {
175        "labels": [
176          "csisolatin9",
177          "iso-8859-15",
178          "iso8859-15",
179          "iso885915",
180          "iso_8859-15",
181          "l9"
182        ],
183        "name": "ISO-8859-15"
184      },
185      {
186        "labels": [
187          "iso-8859-16"
188        ],
189        "name": "ISO-8859-16"
190      },
191      {
192        "labels": [
193          "cskoi8r",
194          "koi",
195          "koi8",
196          "koi8-r",
197          "koi8_r"
198        ],
199        "name": "KOI8-R"
200      },
201      {
202        "labels": [
203          "koi8-ru",
204          "koi8-u"
205        ],
206        "name": "KOI8-U"
207      },
208      {
209        "labels": [
210          "csmacintosh",
211          "mac",
212          "macintosh",
213          "x-mac-roman"
214        ],
215        "name": "macintosh"
216      },
217      {
218        "labels": [
219          "dos-874",
220          "iso-8859-11",
221          "iso8859-11",
222          "iso885911",
223          "tis-620",
224          "windows-874"
225        ],
226        "name": "windows-874"
227      },
228      {
229        "labels": [
230          "cp1250",
231          "windows-1250",
232          "x-cp1250"
233        ],
234        "name": "windows-1250"
235      },
236      {
237        "labels": [
238          "cp1251",
239          "windows-1251",
240          "x-cp1251"
241        ],
242        "name": "windows-1251"
243      },
244      {
245        "labels": [
246          "ansi_x3.4-1968",
247          "ascii",
248          "cp1252",
249          "cp819",
250          "csisolatin1",
251          "ibm819",
252          "iso-8859-1",
253          "iso-ir-100",
254          "iso8859-1",
255          "iso88591",
256          "iso_8859-1",
257          "iso_8859-1:1987",
258          "l1",
259          "latin1",
260          "us-ascii",
261          "windows-1252",
262          "x-cp1252"
263        ],
264        "name": "windows-1252"
265      },
266      {
267        "labels": [
268          "cp1253",
269          "windows-1253",
270          "x-cp1253"
271        ],
272        "name": "windows-1253"
273      },
274      {
275        "labels": [
276          "cp1254",
277          "csisolatin5",
278          "iso-8859-9",
279          "iso-ir-148",
280          "iso8859-9",
281          "iso88599",
282          "iso_8859-9",
283          "iso_8859-9:1989",
284          "l5",
285          "latin5",
286          "windows-1254",
287          "x-cp1254"
288        ],
289        "name": "windows-1254"
290      },
291      {
292        "labels": [
293          "cp1255",
294          "windows-1255",
295          "x-cp1255"
296        ],
297        "name": "windows-1255"
298      },
299      {
300        "labels": [
301          "cp1256",
302          "windows-1256",
303          "x-cp1256"
304        ],
305        "name": "windows-1256"
306      },
307      {
308        "labels": [
309          "cp1257",
310          "windows-1257",
311          "x-cp1257"
312        ],
313        "name": "windows-1257"
314      },
315      {
316        "labels": [
317          "cp1258",
318          "windows-1258",
319          "x-cp1258"
320        ],
321        "name": "windows-1258"
322      },
323      {
324        "labels": [
325          "x-mac-cyrillic",
326          "x-mac-ukrainian"
327        ],
328        "name": "x-mac-cyrillic"
329      }
330    ],
331    "heading": "Legacy single-byte encodings"
332  },
333  {
334    "encodings": [
335      {
336        "labels": [
337          "chinese",
338          "csgb2312",
339          "csiso58gb231280",
340          "gb2312",
341          "gb_2312",
342          "gb_2312-80",
343          "gbk",
344          "iso-ir-58",
345          "x-gbk"
346        ],
347        "name": "GBK"
348      },
349      {
350        "labels": [
351          "gb18030"
352        ],
353        "name": "gb18030"
354      }
355    ],
356    "heading": "Legacy multi-byte Chinese (simplified) encodings"
357  },
358  {
359    "encodings": [
360      {
361        "labels": [
362          "big5",
363          "big5-hkscs",
364          "cn-big5",
365          "csbig5",
366          "x-x-big5"
367        ],
368        "name": "Big5"
369      }
370    ],
371    "heading": "Legacy multi-byte Chinese (traditional) encodings"
372  },
373  {
374    "encodings": [
375      {
376        "labels": [
377          "cseucpkdfmtjapanese",
378          "euc-jp",
379          "x-euc-jp"
380        ],
381        "name": "EUC-JP"
382      },
383      {
384        "labels": [
385          "csiso2022jp",
386          "iso-2022-jp"
387        ],
388        "name": "ISO-2022-JP"
389      },
390      {
391        "labels": [
392          "csshiftjis",
393          "ms932",
394          "ms_kanji",
395          "shift-jis",
396          "shift_jis",
397          "sjis",
398          "windows-31j",
399          "x-sjis"
400        ],
401        "name": "Shift_JIS"
402      }
403    ],
404    "heading": "Legacy multi-byte Japanese encodings"
405  },
406  {
407    "encodings": [
408      {
409        "labels": [
410          "cseuckr",
411          "csksc56011987",
412          "euc-kr",
413          "iso-ir-149",
414          "korean",
415          "ks_c_5601-1987",
416          "ks_c_5601-1989",
417          "ksc5601",
418          "ksc_5601",
419          "windows-949"
420        ],
421        "name": "EUC-KR"
422      }
423    ],
424    "heading": "Legacy multi-byte Korean encodings"
425  },
426  {
427    "encodings": [
428      {
429        "labels": [
430          "csiso2022kr",
431          "hz-gb-2312",
432          "iso-2022-cn",
433          "iso-2022-cn-ext",
434          "iso-2022-kr",
435          "replacement"
436        ],
437        "name": "replacement"
438      },
439      {
440        "labels": [
441          "utf-16be"
442        ],
443        "name": "UTF-16BE"
444      },
445      {
446        "labels": [
447          "utf-16",
448          "utf-16le"
449        ],
450        "name": "UTF-16LE"
451      },
452      {
453        "labels": [
454          "x-user-defined"
455        ],
456        "name": "x-user-defined"
457      }
458    ],
459    "heading": "Legacy miscellaneous encodings"
460  }
461]
462;
463