encoding.labels.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // See https://encoding.spec.whatwg.org/#names-and-labels
  2. /* eslint-disable @exodus/export-default/named */
  3. // prettier-ignore
  4. const labels = {
  5. 'utf-8': ['unicode-1-1-utf-8', 'unicode11utf8', 'unicode20utf8', 'utf8', 'x-unicode20utf8'],
  6. 'utf-16be': ['unicodefffe'],
  7. 'utf-16le': ['csunicode', 'iso-10646-ucs-2', 'ucs-2', 'unicode', 'unicodefeff', 'utf-16'],
  8. 'iso-8859-2': ['iso-ir-101'],
  9. 'iso-8859-3': ['iso-ir-109'],
  10. 'iso-8859-4': ['iso-ir-110'],
  11. 'iso-8859-5': ['csisolatincyrillic', 'cyrillic', 'iso-ir-144'],
  12. 'iso-8859-6': ['arabic', 'asmo-708', 'csiso88596e', 'csiso88596i', 'csisolatinarabic', 'ecma-114', 'iso-8859-6-e', 'iso-8859-6-i', 'iso-ir-127'],
  13. 'iso-8859-7': ['csisolatingreek', 'ecma-118', 'elot_928', 'greek', 'greek8', 'iso-ir-126', 'sun_eu_greek'],
  14. 'iso-8859-8': ['csiso88598e', 'csisolatinhebrew', 'hebrew', 'iso-8859-8-e', 'iso-ir-138', 'visual'],
  15. 'iso-8859-8-i': ['csiso88598i', 'logical'],
  16. 'iso-8859-16': [],
  17. 'koi8-r': ['cskoi8r', 'koi', 'koi8', 'koi8_r'],
  18. 'koi8-u': ['koi8-ru'],
  19. 'windows-874': ['dos-874', 'iso-8859-11', 'iso8859-11', 'iso885911', 'tis-620'],
  20. ibm866: ['866', 'cp866', 'csibm866'],
  21. 'x-mac-cyrillic': ['x-mac-ukrainian'],
  22. macintosh: ['csmacintosh', 'mac', 'x-mac-roman'],
  23. gbk: ['chinese', 'csgb2312', 'csiso58gb231280', 'gb2312', 'gb_2312', 'gb_2312-80', 'iso-ir-58', 'x-gbk'],
  24. gb18030: [],
  25. big5: ['big5-hkscs', 'cn-big5', 'csbig5', 'x-x-big5'],
  26. 'euc-jp': ['cseucpkdfmtjapanese', 'x-euc-jp'],
  27. shift_jis: ['csshiftjis', 'ms932', 'ms_kanji', 'shift-jis', 'sjis', 'windows-31j', 'x-sjis'],
  28. 'euc-kr': ['cseuckr', 'csksc56011987', 'iso-ir-149', 'korean', 'ks_c_5601-1987', 'ks_c_5601-1989', 'ksc5601', 'ksc_5601', 'windows-949'],
  29. 'iso-2022-jp': ['csiso2022jp'],
  30. replacement: ['csiso2022kr', 'hz-gb-2312', 'iso-2022-cn', 'iso-2022-cn-ext', 'iso-2022-kr'],
  31. 'x-user-defined': [],
  32. }
  33. for (const i of [10, 13, 14, 15]) labels[`iso-8859-${i}`] = [`iso8859-${i}`, `iso8859${i}`]
  34. for (const i of [2, 6, 7]) labels[`iso-8859-${i}`].push(`iso_8859-${i}:1987`)
  35. for (const i of [3, 4, 5, 8]) labels[`iso-8859-${i}`].push(`iso_8859-${i}:1988`)
  36. // prettier-ignore
  37. for (let i = 2; i < 9; i++) labels[`iso-8859-${i}`].push(`iso8859-${i}`, `iso8859${i}`, `iso_8859-${i}`)
  38. for (let i = 2; i < 5; i++) labels[`iso-8859-${i}`].push(`csisolatin${i}`, `l${i}`, `latin${i}`)
  39. for (let i = 0; i < 9; i++) labels[`windows-125${i}`] = [`cp125${i}`, `x-cp125${i}`]
  40. // prettier-ignore
  41. labels['windows-1252'].push('ansi_x3.4-1968', 'ascii', 'cp819', 'csisolatin1', 'ibm819', 'iso-8859-1', 'iso-ir-100', 'iso8859-1', 'iso88591', 'iso_8859-1', 'iso_8859-1:1987', 'l1', 'latin1', 'us-ascii')
  42. // prettier-ignore
  43. labels['windows-1254'].push('csisolatin5', 'iso-8859-9', 'iso-ir-148', 'iso8859-9', 'iso88599', 'iso_8859-9', 'iso_8859-9:1989', 'l5', 'latin5')
  44. labels['iso-8859-10'].push('csisolatin6', 'iso-ir-157', 'l6', 'latin6')
  45. labels['iso-8859-15'].push('csisolatin9', 'iso_8859-15', 'l9')
  46. export default labels