1 // Any copyright to the test code below this comment is dedicated to the
2 // Public Domain. http://creativecommons.org/publicdomain/zero/1.0/
3 
4 // THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
5 // Instead, please regenerate using generate-encoding-data.py
6 
7 use super::*;
8 
9 #[test]
test_all_labels()10 fn test_all_labels() {
11     assert_eq!(Encoding::for_label(b"l1"), Some(WINDOWS_1252));
12     assert_eq!(Encoding::for_label(b"l2"), Some(ISO_8859_2));
13     assert_eq!(Encoding::for_label(b"l3"), Some(ISO_8859_3));
14     assert_eq!(Encoding::for_label(b"l4"), Some(ISO_8859_4));
15     assert_eq!(Encoding::for_label(b"l5"), Some(WINDOWS_1254));
16     assert_eq!(Encoding::for_label(b"l6"), Some(ISO_8859_10));
17     assert_eq!(Encoding::for_label(b"l9"), Some(ISO_8859_15));
18     assert_eq!(Encoding::for_label(b"866"), Some(IBM866));
19     assert_eq!(Encoding::for_label(b"mac"), Some(MACINTOSH));
20     assert_eq!(Encoding::for_label(b"koi"), Some(KOI8_R));
21     assert_eq!(Encoding::for_label(b"gbk"), Some(GBK));
22     assert_eq!(Encoding::for_label(b"big5"), Some(BIG5));
23     assert_eq!(Encoding::for_label(b"utf8"), Some(UTF_8));
24     assert_eq!(Encoding::for_label(b"koi8"), Some(KOI8_R));
25     assert_eq!(Encoding::for_label(b"sjis"), Some(SHIFT_JIS));
26     assert_eq!(Encoding::for_label(b"ms932"), Some(SHIFT_JIS));
27     assert_eq!(Encoding::for_label(b"cp866"), Some(IBM866));
28     assert_eq!(Encoding::for_label(b"utf-8"), Some(UTF_8));
29     assert_eq!(Encoding::for_label(b"cp819"), Some(WINDOWS_1252));
30     assert_eq!(Encoding::for_label(b"ascii"), Some(WINDOWS_1252));
31     assert_eq!(Encoding::for_label(b"x-gbk"), Some(GBK));
32     assert_eq!(Encoding::for_label(b"greek"), Some(ISO_8859_7));
33     assert_eq!(Encoding::for_label(b"cp1250"), Some(WINDOWS_1250));
34     assert_eq!(Encoding::for_label(b"cp1251"), Some(WINDOWS_1251));
35     assert_eq!(Encoding::for_label(b"latin1"), Some(WINDOWS_1252));
36     assert_eq!(Encoding::for_label(b"gb2312"), Some(GBK));
37     assert_eq!(Encoding::for_label(b"cp1252"), Some(WINDOWS_1252));
38     assert_eq!(Encoding::for_label(b"latin2"), Some(ISO_8859_2));
39     assert_eq!(Encoding::for_label(b"cp1253"), Some(WINDOWS_1253));
40     assert_eq!(Encoding::for_label(b"latin3"), Some(ISO_8859_3));
41     assert_eq!(Encoding::for_label(b"cp1254"), Some(WINDOWS_1254));
42     assert_eq!(Encoding::for_label(b"latin4"), Some(ISO_8859_4));
43     assert_eq!(Encoding::for_label(b"cp1255"), Some(WINDOWS_1255));
44     assert_eq!(Encoding::for_label(b"csbig5"), Some(BIG5));
45     assert_eq!(Encoding::for_label(b"latin5"), Some(WINDOWS_1254));
46     assert_eq!(Encoding::for_label(b"utf-16"), Some(UTF_16LE));
47     assert_eq!(Encoding::for_label(b"cp1256"), Some(WINDOWS_1256));
48     assert_eq!(Encoding::for_label(b"ibm866"), Some(IBM866));
49     assert_eq!(Encoding::for_label(b"latin6"), Some(ISO_8859_10));
50     assert_eq!(Encoding::for_label(b"cp1257"), Some(WINDOWS_1257));
51     assert_eq!(Encoding::for_label(b"cp1258"), Some(WINDOWS_1258));
52     assert_eq!(Encoding::for_label(b"greek8"), Some(ISO_8859_7));
53     assert_eq!(Encoding::for_label(b"ibm819"), Some(WINDOWS_1252));
54     assert_eq!(Encoding::for_label(b"arabic"), Some(ISO_8859_6));
55     assert_eq!(Encoding::for_label(b"visual"), Some(ISO_8859_8));
56     assert_eq!(Encoding::for_label(b"korean"), Some(EUC_KR));
57     assert_eq!(Encoding::for_label(b"euc-jp"), Some(EUC_JP));
58     assert_eq!(Encoding::for_label(b"koi8-r"), Some(KOI8_R));
59     assert_eq!(Encoding::for_label(b"koi8_r"), Some(KOI8_R));
60     assert_eq!(Encoding::for_label(b"euc-kr"), Some(EUC_KR));
61     assert_eq!(Encoding::for_label(b"x-sjis"), Some(SHIFT_JIS));
62     assert_eq!(Encoding::for_label(b"koi8-u"), Some(KOI8_U));
63     assert_eq!(Encoding::for_label(b"hebrew"), Some(ISO_8859_8));
64     assert_eq!(Encoding::for_label(b"tis-620"), Some(WINDOWS_874));
65     assert_eq!(Encoding::for_label(b"gb18030"), Some(GB18030));
66     assert_eq!(Encoding::for_label(b"ksc5601"), Some(EUC_KR));
67     assert_eq!(Encoding::for_label(b"gb_2312"), Some(GBK));
68     assert_eq!(Encoding::for_label(b"dos-874"), Some(WINDOWS_874));
69     assert_eq!(Encoding::for_label(b"cn-big5"), Some(BIG5));
70     assert_eq!(Encoding::for_label(b"chinese"), Some(GBK));
71     assert_eq!(Encoding::for_label(b"logical"), Some(ISO_8859_8_I));
72     assert_eq!(Encoding::for_label(b"cskoi8r"), Some(KOI8_R));
73     assert_eq!(Encoding::for_label(b"cseuckr"), Some(EUC_KR));
74     assert_eq!(Encoding::for_label(b"koi8-ru"), Some(KOI8_U));
75     assert_eq!(Encoding::for_label(b"x-cp1250"), Some(WINDOWS_1250));
76     assert_eq!(Encoding::for_label(b"ksc_5601"), Some(EUC_KR));
77     assert_eq!(Encoding::for_label(b"x-cp1251"), Some(WINDOWS_1251));
78     assert_eq!(Encoding::for_label(b"iso88591"), Some(WINDOWS_1252));
79     assert_eq!(Encoding::for_label(b"csgb2312"), Some(GBK));
80     assert_eq!(Encoding::for_label(b"x-cp1252"), Some(WINDOWS_1252));
81     assert_eq!(Encoding::for_label(b"iso88592"), Some(ISO_8859_2));
82     assert_eq!(Encoding::for_label(b"x-cp1253"), Some(WINDOWS_1253));
83     assert_eq!(Encoding::for_label(b"iso88593"), Some(ISO_8859_3));
84     assert_eq!(Encoding::for_label(b"ecma-114"), Some(ISO_8859_6));
85     assert_eq!(Encoding::for_label(b"x-cp1254"), Some(WINDOWS_1254));
86     assert_eq!(Encoding::for_label(b"iso88594"), Some(ISO_8859_4));
87     assert_eq!(Encoding::for_label(b"x-cp1255"), Some(WINDOWS_1255));
88     assert_eq!(Encoding::for_label(b"iso88595"), Some(ISO_8859_5));
89     assert_eq!(Encoding::for_label(b"x-x-big5"), Some(BIG5));
90     assert_eq!(Encoding::for_label(b"x-cp1256"), Some(WINDOWS_1256));
91     assert_eq!(Encoding::for_label(b"csibm866"), Some(IBM866));
92     assert_eq!(Encoding::for_label(b"iso88596"), Some(ISO_8859_6));
93     assert_eq!(Encoding::for_label(b"x-cp1257"), Some(WINDOWS_1257));
94     assert_eq!(Encoding::for_label(b"iso88597"), Some(ISO_8859_7));
95     assert_eq!(Encoding::for_label(b"asmo-708"), Some(ISO_8859_6));
96     assert_eq!(Encoding::for_label(b"ecma-118"), Some(ISO_8859_7));
97     assert_eq!(Encoding::for_label(b"elot_928"), Some(ISO_8859_7));
98     assert_eq!(Encoding::for_label(b"x-cp1258"), Some(WINDOWS_1258));
99     assert_eq!(Encoding::for_label(b"iso88598"), Some(ISO_8859_8));
100     assert_eq!(Encoding::for_label(b"iso88599"), Some(WINDOWS_1254));
101     assert_eq!(Encoding::for_label(b"cyrillic"), Some(ISO_8859_5));
102     assert_eq!(Encoding::for_label(b"utf-16be"), Some(UTF_16BE));
103     assert_eq!(Encoding::for_label(b"utf-16le"), Some(UTF_16LE));
104     assert_eq!(Encoding::for_label(b"us-ascii"), Some(WINDOWS_1252));
105     assert_eq!(Encoding::for_label(b"ms_kanji"), Some(SHIFT_JIS));
106     assert_eq!(Encoding::for_label(b"x-euc-jp"), Some(EUC_JP));
107     assert_eq!(Encoding::for_label(b"iso885910"), Some(ISO_8859_10));
108     assert_eq!(Encoding::for_label(b"iso8859-1"), Some(WINDOWS_1252));
109     assert_eq!(Encoding::for_label(b"iso885911"), Some(WINDOWS_874));
110     assert_eq!(Encoding::for_label(b"iso8859-2"), Some(ISO_8859_2));
111     assert_eq!(Encoding::for_label(b"iso8859-3"), Some(ISO_8859_3));
112     assert_eq!(Encoding::for_label(b"iso885913"), Some(ISO_8859_13));
113     assert_eq!(Encoding::for_label(b"iso8859-4"), Some(ISO_8859_4));
114     assert_eq!(Encoding::for_label(b"iso885914"), Some(ISO_8859_14));
115     assert_eq!(Encoding::for_label(b"iso8859-5"), Some(ISO_8859_5));
116     assert_eq!(Encoding::for_label(b"iso885915"), Some(ISO_8859_15));
117     assert_eq!(Encoding::for_label(b"iso8859-6"), Some(ISO_8859_6));
118     assert_eq!(Encoding::for_label(b"iso8859-7"), Some(ISO_8859_7));
119     assert_eq!(Encoding::for_label(b"iso8859-8"), Some(ISO_8859_8));
120     assert_eq!(Encoding::for_label(b"iso-ir-58"), Some(GBK));
121     assert_eq!(Encoding::for_label(b"iso8859-9"), Some(WINDOWS_1254));
122     assert_eq!(Encoding::for_label(b"macintosh"), Some(MACINTOSH));
123     assert_eq!(Encoding::for_label(b"shift-jis"), Some(SHIFT_JIS));
124     assert_eq!(Encoding::for_label(b"shift_jis"), Some(SHIFT_JIS));
125     assert_eq!(Encoding::for_label(b"iso-ir-100"), Some(WINDOWS_1252));
126     assert_eq!(Encoding::for_label(b"iso8859-10"), Some(ISO_8859_10));
127     assert_eq!(Encoding::for_label(b"iso-ir-110"), Some(ISO_8859_4));
128     assert_eq!(Encoding::for_label(b"gb_2312-80"), Some(GBK));
129     assert_eq!(Encoding::for_label(b"iso-8859-1"), Some(WINDOWS_1252));
130     assert_eq!(Encoding::for_label(b"iso_8859-1"), Some(WINDOWS_1252));
131     assert_eq!(Encoding::for_label(b"iso-ir-101"), Some(ISO_8859_2));
132     assert_eq!(Encoding::for_label(b"iso8859-11"), Some(WINDOWS_874));
133     assert_eq!(Encoding::for_label(b"iso-8859-2"), Some(ISO_8859_2));
134     assert_eq!(Encoding::for_label(b"iso_8859-2"), Some(ISO_8859_2));
135     assert_eq!(Encoding::for_label(b"hz-gb-2312"), Some(REPLACEMENT));
136     assert_eq!(Encoding::for_label(b"iso-8859-3"), Some(ISO_8859_3));
137     assert_eq!(Encoding::for_label(b"iso_8859-3"), Some(ISO_8859_3));
138     assert_eq!(Encoding::for_label(b"iso8859-13"), Some(ISO_8859_13));
139     assert_eq!(Encoding::for_label(b"iso-8859-4"), Some(ISO_8859_4));
140     assert_eq!(Encoding::for_label(b"iso_8859-4"), Some(ISO_8859_4));
141     assert_eq!(Encoding::for_label(b"iso8859-14"), Some(ISO_8859_14));
142     assert_eq!(Encoding::for_label(b"iso-ir-144"), Some(ISO_8859_5));
143     assert_eq!(Encoding::for_label(b"iso-8859-5"), Some(ISO_8859_5));
144     assert_eq!(Encoding::for_label(b"iso_8859-5"), Some(ISO_8859_5));
145     assert_eq!(Encoding::for_label(b"iso8859-15"), Some(ISO_8859_15));
146     assert_eq!(Encoding::for_label(b"iso-8859-6"), Some(ISO_8859_6));
147     assert_eq!(Encoding::for_label(b"iso_8859-6"), Some(ISO_8859_6));
148     assert_eq!(Encoding::for_label(b"iso-ir-126"), Some(ISO_8859_7));
149     assert_eq!(Encoding::for_label(b"iso-8859-7"), Some(ISO_8859_7));
150     assert_eq!(Encoding::for_label(b"iso_8859-7"), Some(ISO_8859_7));
151     assert_eq!(Encoding::for_label(b"iso-ir-127"), Some(ISO_8859_6));
152     assert_eq!(Encoding::for_label(b"iso-ir-157"), Some(ISO_8859_10));
153     assert_eq!(Encoding::for_label(b"iso-8859-8"), Some(ISO_8859_8));
154     assert_eq!(Encoding::for_label(b"iso_8859-8"), Some(ISO_8859_8));
155     assert_eq!(Encoding::for_label(b"iso-ir-138"), Some(ISO_8859_8));
156     assert_eq!(Encoding::for_label(b"iso-ir-148"), Some(WINDOWS_1254));
157     assert_eq!(Encoding::for_label(b"iso-8859-9"), Some(WINDOWS_1254));
158     assert_eq!(Encoding::for_label(b"iso_8859-9"), Some(WINDOWS_1254));
159     assert_eq!(Encoding::for_label(b"iso-ir-109"), Some(ISO_8859_3));
160     assert_eq!(Encoding::for_label(b"iso-ir-149"), Some(EUC_KR));
161     assert_eq!(Encoding::for_label(b"big5-hkscs"), Some(BIG5));
162     assert_eq!(Encoding::for_label(b"csshiftjis"), Some(SHIFT_JIS));
163     assert_eq!(Encoding::for_label(b"iso-8859-10"), Some(ISO_8859_10));
164     assert_eq!(Encoding::for_label(b"iso-8859-11"), Some(WINDOWS_874));
165     assert_eq!(Encoding::for_label(b"csisolatin1"), Some(WINDOWS_1252));
166     assert_eq!(Encoding::for_label(b"csisolatin2"), Some(ISO_8859_2));
167     assert_eq!(Encoding::for_label(b"iso-8859-13"), Some(ISO_8859_13));
168     assert_eq!(Encoding::for_label(b"csisolatin3"), Some(ISO_8859_3));
169     assert_eq!(Encoding::for_label(b"iso-8859-14"), Some(ISO_8859_14));
170     assert_eq!(Encoding::for_label(b"windows-874"), Some(WINDOWS_874));
171     assert_eq!(Encoding::for_label(b"csisolatin4"), Some(ISO_8859_4));
172     assert_eq!(Encoding::for_label(b"iso-8859-15"), Some(ISO_8859_15));
173     assert_eq!(Encoding::for_label(b"iso_8859-15"), Some(ISO_8859_15));
174     assert_eq!(Encoding::for_label(b"csisolatin5"), Some(WINDOWS_1254));
175     assert_eq!(Encoding::for_label(b"iso-8859-16"), Some(ISO_8859_16));
176     assert_eq!(Encoding::for_label(b"csisolatin6"), Some(ISO_8859_10));
177     assert_eq!(Encoding::for_label(b"windows-949"), Some(EUC_KR));
178     assert_eq!(Encoding::for_label(b"csisolatin9"), Some(ISO_8859_15));
179     assert_eq!(Encoding::for_label(b"csiso88596e"), Some(ISO_8859_6));
180     assert_eq!(Encoding::for_label(b"csiso88598e"), Some(ISO_8859_8));
181     assert_eq!(Encoding::for_label(b"csmacintosh"), Some(MACINTOSH));
182     assert_eq!(Encoding::for_label(b"csiso88596i"), Some(ISO_8859_6));
183     assert_eq!(Encoding::for_label(b"csiso88598i"), Some(ISO_8859_8_I));
184     assert_eq!(Encoding::for_label(b"windows-31j"), Some(SHIFT_JIS));
185     assert_eq!(Encoding::for_label(b"x-mac-roman"), Some(MACINTOSH));
186     assert_eq!(Encoding::for_label(b"iso-2022-cn"), Some(REPLACEMENT));
187     assert_eq!(Encoding::for_label(b"iso-2022-jp"), Some(ISO_2022_JP));
188     assert_eq!(Encoding::for_label(b"csiso2022jp"), Some(ISO_2022_JP));
189     assert_eq!(Encoding::for_label(b"iso-2022-kr"), Some(REPLACEMENT));
190     assert_eq!(Encoding::for_label(b"csiso2022kr"), Some(REPLACEMENT));
191     assert_eq!(Encoding::for_label(b"replacement"), Some(REPLACEMENT));
192     assert_eq!(Encoding::for_label(b"windows-1250"), Some(WINDOWS_1250));
193     assert_eq!(Encoding::for_label(b"windows-1251"), Some(WINDOWS_1251));
194     assert_eq!(Encoding::for_label(b"windows-1252"), Some(WINDOWS_1252));
195     assert_eq!(Encoding::for_label(b"windows-1253"), Some(WINDOWS_1253));
196     assert_eq!(Encoding::for_label(b"windows-1254"), Some(WINDOWS_1254));
197     assert_eq!(Encoding::for_label(b"windows-1255"), Some(WINDOWS_1255));
198     assert_eq!(Encoding::for_label(b"windows-1256"), Some(WINDOWS_1256));
199     assert_eq!(Encoding::for_label(b"windows-1257"), Some(WINDOWS_1257));
200     assert_eq!(Encoding::for_label(b"windows-1258"), Some(WINDOWS_1258));
201     assert_eq!(Encoding::for_label(b"iso-8859-6-e"), Some(ISO_8859_6));
202     assert_eq!(Encoding::for_label(b"iso-8859-8-e"), Some(ISO_8859_8));
203     assert_eq!(Encoding::for_label(b"iso-8859-6-i"), Some(ISO_8859_6));
204     assert_eq!(Encoding::for_label(b"iso-8859-8-i"), Some(ISO_8859_8_I));
205     assert_eq!(Encoding::for_label(b"sun_eu_greek"), Some(ISO_8859_7));
206     assert_eq!(Encoding::for_label(b"csksc56011987"), Some(EUC_KR));
207     assert_eq!(Encoding::for_label(b"ks_c_5601-1987"), Some(EUC_KR));
208     assert_eq!(Encoding::for_label(b"ansi_x3.4-1968"), Some(WINDOWS_1252));
209     assert_eq!(Encoding::for_label(b"ks_c_5601-1989"), Some(EUC_KR));
210     assert_eq!(Encoding::for_label(b"x-mac-cyrillic"), Some(X_MAC_CYRILLIC));
211     assert_eq!(Encoding::for_label(b"x-user-defined"), Some(X_USER_DEFINED));
212     assert_eq!(Encoding::for_label(b"csiso58gb231280"), Some(GBK));
213     assert_eq!(Encoding::for_label(b"iso_8859-1:1987"), Some(WINDOWS_1252));
214     assert_eq!(Encoding::for_label(b"iso_8859-2:1987"), Some(ISO_8859_2));
215     assert_eq!(Encoding::for_label(b"iso_8859-6:1987"), Some(ISO_8859_6));
216     assert_eq!(Encoding::for_label(b"iso_8859-7:1987"), Some(ISO_8859_7));
217     assert_eq!(Encoding::for_label(b"iso_8859-3:1988"), Some(ISO_8859_3));
218     assert_eq!(Encoding::for_label(b"iso_8859-4:1988"), Some(ISO_8859_4));
219     assert_eq!(Encoding::for_label(b"iso_8859-5:1988"), Some(ISO_8859_5));
220     assert_eq!(Encoding::for_label(b"iso_8859-8:1988"), Some(ISO_8859_8));
221     assert_eq!(Encoding::for_label(b"iso_8859-9:1989"), Some(WINDOWS_1254));
222     assert_eq!(Encoding::for_label(b"csisolatingreek"), Some(ISO_8859_7));
223     assert_eq!(
224         Encoding::for_label(b"x-mac-ukrainian"),
225         Some(X_MAC_CYRILLIC)
226     );
227     assert_eq!(Encoding::for_label(b"iso-2022-cn-ext"), Some(REPLACEMENT));
228     assert_eq!(Encoding::for_label(b"csisolatinarabic"), Some(ISO_8859_6));
229     assert_eq!(Encoding::for_label(b"csisolatinhebrew"), Some(ISO_8859_8));
230     assert_eq!(Encoding::for_label(b"unicode-1-1-utf-8"), Some(UTF_8));
231     assert_eq!(Encoding::for_label(b"csisolatincyrillic"), Some(ISO_8859_5));
232     assert_eq!(Encoding::for_label(b"cseucpkdfmtjapanese"), Some(EUC_JP));
233 }
234