tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Document-characterSet-normalization-2.html (3138B)


      1 <!doctype html>
      2 <title>document.characterSet (inputEncoding and charset as aliases) normalization tests</title>
      3 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
      4 <meta name=timeout content=long>
      5 <div id=log></div>
      6 <script src=/resources/testharness.js></script>
      7 <script src=/resources/testharnessreport.js></script>
      8 <script src="./characterset-helper.js"></script>
      9 <style>iframe { display: none }</style>
     10 <script>
     11 "use strict";
     12 
     13 // Taken straight from https://encoding.spec.whatwg.org/
     14 var encodingMap = {
     15  "KOI8-R": [
     16    "cskoi8r",
     17    "koi",
     18    "koi8",
     19    "koi8-r",
     20    "koi8_r",
     21  ],
     22  "KOI8-U": [
     23    "koi8-ru",
     24    "koi8-u",
     25  ],
     26  "macintosh": [
     27    "csmacintosh",
     28    "mac",
     29    "macintosh",
     30    "x-mac-roman",
     31  ],
     32  "windows-874": [
     33    "dos-874",
     34    "iso-8859-11",
     35    "iso8859-11",
     36    "iso885911",
     37    "tis-620",
     38    "windows-874",
     39  ],
     40  "windows-1250": [
     41    "cp1250",
     42    "windows-1250",
     43    "x-cp1250",
     44  ],
     45  "windows-1251": [
     46    "cp1251",
     47    "windows-1251",
     48    "x-cp1251",
     49  ],
     50  "windows-1252": [
     51    "ansi_x3.4-1968",
     52    "ascii",
     53    "cp1252",
     54    "cp819",
     55    "csisolatin1",
     56    "ibm819",
     57    "iso-8859-1",
     58    "iso-ir-100",
     59    "iso8859-1",
     60    "iso88591",
     61    "iso_8859-1",
     62    "iso_8859-1:1987",
     63    "l1",
     64    "latin1",
     65    "us-ascii",
     66    "windows-1252",
     67    "x-cp1252",
     68    // As we use <meta>, x-user-defined will map to windows-1252 per
     69    // https://html.spec.whatwg.org/multipage/#documentEncoding
     70    "x-user-defined"
     71  ],
     72  "windows-1253": [
     73    "cp1253",
     74    "windows-1253",
     75    "x-cp1253",
     76  ],
     77  "windows-1254": [
     78    "cp1254",
     79    "csisolatin5",
     80    "iso-8859-9",
     81    "iso-ir-148",
     82    "iso8859-9",
     83    "iso88599",
     84    "iso_8859-9",
     85    "iso_8859-9:1989",
     86    "l5",
     87    "latin5",
     88    "windows-1254",
     89    "x-cp1254",
     90  ],
     91  "windows-1255": [
     92    "cp1255",
     93    "windows-1255",
     94    "x-cp1255",
     95  ],
     96  "windows-1256": [
     97    "cp1256",
     98    "windows-1256",
     99    "x-cp1256",
    100  ],
    101  "windows-1257": [
    102    "cp1257",
    103    "windows-1257",
    104    "x-cp1257",
    105  ],
    106  "windows-1258": [
    107    "cp1258",
    108    "windows-1258",
    109    "x-cp1258",
    110  ],
    111  "x-mac-cyrillic": [
    112    "x-mac-cyrillic",
    113    "x-mac-ukrainian",
    114  ],
    115  "GBK": [
    116    "chinese",
    117    "csgb2312",
    118    "csiso58gb231280",
    119    "gb2312",
    120    "gb_2312",
    121    "gb_2312-80",
    122    "gbk",
    123    "iso-ir-58",
    124    "x-gbk",
    125  ],
    126  "gb18030": [
    127    "gb18030",
    128  ],
    129  "Big5": [
    130    "big5",
    131    "big5-hkscs",
    132    "cn-big5",
    133    "csbig5",
    134    "x-x-big5",
    135  ],
    136  "EUC-JP": [
    137    "cseucpkdfmtjapanese",
    138    "euc-jp",
    139    "x-euc-jp",
    140  ],
    141  "ISO-2022-JP": [
    142    "csiso2022jp",
    143    "iso-2022-jp",
    144  ],
    145  "Shift_JIS": [
    146    "csshiftjis",
    147    "ms932",
    148    "ms_kanji",
    149    "shift-jis",
    150    "shift_jis",
    151    "sjis",
    152    "windows-31j",
    153    "x-sjis",
    154  ],
    155  "EUC-KR": [
    156    "cseuckr",
    157    "csksc56011987",
    158    "euc-kr",
    159    "iso-ir-149",
    160    "korean",
    161    "ks_c_5601-1987",
    162    "ks_c_5601-1989",
    163    "ksc5601",
    164    "ksc_5601",
    165    "windows-949",
    166  ],
    167  "replacement": [
    168    "csiso2022kr",
    169    "hz-gb-2312",
    170    "iso-2022-cn",
    171    "iso-2022-cn-ext",
    172    "iso-2022-kr",
    173  ],
    174 };
    175 
    176 runCharacterSetTests(encodingMap);
    177 
    178 </script>
    179 <!-- vim: set expandtab tabstop=2 shiftwidth=2: -->