Fix license issues
[sdnc/oam.git] / dgbuilder / dgeflows / node_modules / body-parser / node_modules / iconv-lite / encodings / dbcs-data.js
1
2 // Description of supported double byte encodings and aliases.
3 // Tables are not require()-d until they are needed to speed up library load.
4 // require()-s are direct to support Browserify.
5
6 module.exports = {
7     
8     // == Japanese/ShiftJIS ====================================================
9     // All japanese encodings are based on JIS X set of standards:
10     // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
11     // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. 
12     //              Has several variations in 1978, 1983, 1990 and 1997.
13     // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
14     // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
15     //              2 planes, first is superset of 0208, second - revised 0212.
16     //              Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
17
18     // Byte encodings are:
19     //  * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
20     //               encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
21     //               Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
22     //  * EUC-JP:    Up to 3 bytes per character. Used mostly on *nixes.
23     //               0x00-0x7F       - lower part of 0201
24     //               0x8E, 0xA1-0xDF - upper part of 0201
25     //               (0xA1-0xFE)x2   - 0208 plane (94x94).
26     //               0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
27     //  * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
28     //               Used as-is in ISO2022 family.
29     //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, 
30     //                0201-1976 Roman, 0208-1978, 0208-1983.
31     //  * ISO2022-JP-1: Adds esc seq for 0212-1990.
32     //  * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
33     //  * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
34     //  * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
35     //
36     // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
37     //
38     // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
39
40
41     'shiftjis': {
42         type: '_dbcs',
43         table: function() { return require('./tables/shiftjis.json') },
44         encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
45         encodeSkipVals: [{from: 0xED40, to: 0xF940}],
46     },
47     'csshiftjis': 'shiftjis',
48     'mskanji': 'shiftjis',
49     'sjis': 'shiftjis',
50     'windows31j': 'shiftjis',
51     'xsjis': 'shiftjis',
52     'windows932': 'shiftjis',
53     '932': 'shiftjis',
54     'cp932': 'shiftjis',
55
56     'eucjp': {
57         type: '_dbcs',
58         table: function() { return require('./tables/eucjp.json') },
59         encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
60     },
61
62     // TODO: KDDI extension to Shift_JIS
63     // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
64     // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
65
66     // == Chinese/GBK ==========================================================
67     // http://en.wikipedia.org/wiki/GBK
68
69     // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
70     'gb2312': 'cp936',
71     'gb231280': 'cp936',
72     'gb23121980': 'cp936',
73     'csgb2312': 'cp936',
74     'csiso58gb231280': 'cp936',
75     'euccn': 'cp936',
76     'isoir58': 'gbk',
77
78     // Microsoft's CP936 is a subset and approximation of GBK.
79     // TODO: Euro = 0x80 in cp936, but not in GBK (where it's valid but undefined)
80     'windows936': 'cp936',
81     '936': 'cp936',
82     'cp936': {
83         type: '_dbcs',
84         table: function() { return require('./tables/cp936.json') },
85     },
86
87     // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
88     'gbk': {
89         type: '_dbcs',
90         table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
91     },
92     'xgbk': 'gbk',
93
94     // GB18030 is an algorithmic extension of GBK.
95     'gb18030': {
96         type: '_dbcs',
97         table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
98         gb18030: function() { return require('./tables/gb18030-ranges.json') },
99     },
100
101     'chinese': 'gb18030',
102
103     // TODO: Support GB18030 (~27000 chars + whole unicode mapping, cp54936)
104     // http://icu-project.org/docs/papers/gb18030.html
105     // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
106     // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
107
108     // == Korean ===============================================================
109     // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
110     'windows949': 'cp949',
111     '949': 'cp949',
112     'cp949': {
113         type: '_dbcs',
114         table: function() { return require('./tables/cp949.json') },
115     },
116
117     'cseuckr': 'cp949',
118     'csksc56011987': 'cp949',
119     'euckr': 'cp949',
120     'isoir149': 'cp949',
121     'korean': 'cp949',
122     'ksc56011987': 'cp949',
123     'ksc56011989': 'cp949',
124     'ksc5601': 'cp949',
125
126
127     // == Big5/Taiwan/Hong Kong ================================================
128     // There are lots of tables for Big5 and cp950. Please see the following links for history:
129     // http://moztw.org/docs/big5/  http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
130     // Variations, in roughly number of defined chars:
131     //  * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
132     //  * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
133     //  * Big5-2003 (Taiwan standard) almost superset of cp950.
134     //  * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
135     //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. 
136     //    many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
137     //    Plus, it has 4 combining sequences.
138     //    Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
139     //    because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
140     //    Implementations are not consistent within browsers; sometimes labeled as just big5.
141     //    MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
142     //    Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
143     //    In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
144     //    Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
145     //                   http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
146     // 
147     // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
148     // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
149
150     'windows950': 'cp950',
151     '950': 'cp950',
152     'cp950': {
153         type: '_dbcs',
154         table: function() { return require('./tables/cp950.json') },
155     },
156
157     // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
158     'big5': 'big5hkscs',
159     'big5hkscs': {
160         type: '_dbcs',
161         table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },
162     },
163
164     'cnbig5': 'big5hkscs',
165     'csbig5': 'big5hkscs',
166     'xxbig5': 'big5hkscs',
167
168 };