3 * Routines and tables for IANA-registered character sets
5 * http://www.iana.org/assignments/character-sets/character-sets.xhtml
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * WAP dissector based on original work by Ben Fowler
12 * Updated by Neil Hunter <neil.hunter@energis-squared.com>
13 * WTLS support by Alexandre P. Ferreira (Splice IP)
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 #include <epan/proto.h>
35 #include <epan/value_string.h>
37 #include <epan/iana_charsets.h>
40 * Map a MIBenum code for a charset to a Wireshark string encoding.
43 mibenum_charset_to_encoding (guint charset)
47 return ENC_NA|ENC_ASCII;
50 return ENC_NA|ENC_ISO_8859_1;
53 return ENC_NA|ENC_ISO_8859_2;
56 return ENC_NA|ENC_ISO_8859_3;
59 return ENC_NA|ENC_ISO_8859_4;
62 return ENC_NA|ENC_ISO_8859_5;
65 return ENC_NA|ENC_ISO_8859_6;
68 return ENC_NA|ENC_ISO_8859_7;
71 return ENC_NA|ENC_ISO_8859_8;
74 return ENC_NA|ENC_ISO_8859_9;
77 return ENC_NA|ENC_ISO_8859_10;
80 return ENC_NA|ENC_UTF_8;
83 return ENC_NA|ENC_ISO_8859_13;
86 return ENC_NA|ENC_ISO_8859_14;
89 return ENC_NA|ENC_ISO_8859_15;
92 return ENC_NA|ENC_ISO_8859_16;
98 * this needs to specify network byte order: the
99 * standard does not specify
101 * so presumably this means "big-endian UCS-2".
103 return ENC_BIG_ENDIAN|ENC_UCS_2;
107 * The IANA page says the same thing as for UCS-2.
109 return ENC_BIG_ENDIAN|ENC_UCS_4;
112 return ENC_BIG_ENDIAN|ENC_UTF_16;
115 return ENC_LITTLE_ENDIAN|ENC_UTF_16;
118 /* XXX - UTF-16 with a BOM at the beginning */
119 return ENC_LITTLE_ENDIAN|ENC_UTF_16;
122 return ENC_NA|ENC_CP437;
125 return ENC_NA|ENC_ISO_8859_11;
128 return ENC_NA|ENC_ASCII;
132 /* Updated from 10/04/2012 version */
133 static const value_string mibenum_vals_character_sets[] = {
142 { 10, "ISO-8859-7" },
143 { 11, "ISO-8859-8" },
144 { 12, "ISO-8859-9" },
145 { 13, "ISO-8859-10" },
146 { 14, "ISO_6937-2-add" },
148 { 16, "JIS_Encoding" },
151 { 19, "Extended_UNIX_Code_Fixed_Width_for_Japanese" },
153 { 21, "SEN_850200_C" },
158 { 26, "NF_Z_62-010" },
159 { 27, "ISO-10646-UTF-1" },
160 { 28, "ISO_646.basic:1983" },
162 { 30, "ISO_646.irv:1983" },
164 { 32, "NATS-SEFI-ADD" },
166 { 34, "NATS-DANO-ADD" },
167 { 35, "SEN_850200_B" },
168 { 36, "KS_C_5601-1987" },
169 { 37, "ISO-2022-KR" },
171 { 39, "ISO-2022-JP" },
172 { 40, "ISO-2022-JP-2" },
173 { 41, "JIS_C6220-1969-jp" },
174 { 42, "JIS_C6220-1969-ro" },
176 { 44, "greek7-old" },
177 { 45, "latin-greek" },
178 { 46, "NF_Z_62-010_(1973)" },
179 { 47, "Latin-greek-1" },
181 { 49, "JIS_C6226-1978" },
182 { 50, "BS_viewdata" },
185 { 53, "INIS-cyrillic" },
186 { 54, "ISO_5427:1981" },
187 { 55, "ISO_5428:1980" },
188 { 56, "GB_1988-80" },
189 { 57, "GB_2312-80" },
191 { 59, "videotex-suppl" },
194 { 62, "MSZ_7795.3" },
195 { 63, "JIS_C6226-1983" },
199 { 67, "JIS_C6229-1984-a" },
200 { 68, "JIS_C6229-1984-b" },
201 { 69, "JIS_C6229-1984-b-add" },
202 { 70, "JIS_C6229-1984-hand" },
203 { 71, "JIS_C6229-1984-hand-add" },
204 { 72, "JIS_C6229-1984-kana" },
205 { 73, "ISO_2033-1983" },
206 { 74, "ANSI_X3.110-1983" },
209 { 77, "ECMA-cyrillic" },
210 { 78, "CSA_Z243.4-1985-1" },
211 { 79, "CSA_Z243.4-1985-2" },
212 { 80, "CSA_Z243.4-1985-gr" },
213 { 81, "ISO-8859-6-E" },
214 { 82, "ISO-8859-6-I" },
216 { 84, "ISO-8859-8-E" },
217 { 85, "ISO-8859-8-I" },
218 { 86, "CSN_369103" },
219 { 87, "JUS_I.B1.002" },
221 { 89, "JUS_I.B1.003-serb" },
222 { 90, "JUS_I.B1.003-mac" },
223 { 91, "greek-ccitt" },
224 { 92, "NC_NC00-10:81" },
225 { 93, "ISO_6937-2-25" },
226 { 94, "GOST_19768-74" },
227 { 95, "ISO_8859-supp" },
228 { 96, "ISO_10367-box" },
230 { 98, "JIS_X0212-1990" },
235 { 103, "UNICODE-1-1-UTF-7" },
236 { 104, "ISO-2022-CN" },
237 { 105, "ISO-2022-CN-EXT" },
239 { 109, "ISO-8859-13" },
240 { 110, "ISO-8859-14" },
241 { 111, "ISO-8859-15" },
242 { 112, "ISO-8859-16" },
245 { 115, "OSD_EBCDIC_DF04_15" },
246 { 116, "OSD_EBCDIC_DF03_IRV" },
247 { 117, "OSD_EBCDIC_DF04_1" },
248 { 118, "ISO-11548-1" },
251 { 1000, "ISO-10646-UCS-2" },
252 { 1001, "ISO-10646-UCS-4" },
253 { 1002, "ISO-10646-UCS-Basic" },
254 { 1003, "ISO-10646-Unicode-Latin1" },
255 { 1004, "ISO-10646-J-1" },
256 { 1005, "ISO-Unicode-IBM-1261" },
257 { 1006, "ISO-Unicode-IBM-1268" },
258 { 1007, "ISO-Unicode-IBM-1276" },
259 { 1008, "ISO-Unicode-IBM-1264" },
260 { 1009, "ISO-Unicode-IBM-1265" },
261 { 1010, "UNICODE-1-1" },
264 { 1013, "UTF-16BE" },
265 { 1014, "UTF-16LE" },
269 { 1018, "UTF-32BE" },
270 { 1019, "UTF-32LE" },
273 { 2000, "ISO-8859-1-Windows-3.0-Latin-1" },
274 { 2001, "ISO-8859-1-Windows-3.1-Latin-1" },
275 { 2002, "ISO-8859-2-Windows-Latin-2" },
276 { 2003, "ISO-8859-9-Windows-Latin-5" },
277 { 2004, "hp-roman8" },
278 { 2005, "Adobe-Standard-Encoding" },
279 { 2006, "Ventura-US" },
280 { 2007, "Ventura-International" },
285 { 2012, "PC8-Danish-Norwegian" },
287 { 2014, "PC8-Turkish" },
288 { 2015, "IBM-Symbols" },
289 { 2016, "IBM-Thai" },
290 { 2017, "HP-Legal" },
291 { 2018, "HP-Pi-font" },
292 { 2019, "HP-Math8" },
293 { 2020, "Adobe-Symbol-Encoding" },
294 { 2021, "HP-DeskTop" },
295 { 2022, "Ventura-Math" },
296 { 2023, "Microsoft-Publishing" },
297 { 2024, "Windows-31J" },
300 { 2027, "macintosh" },
337 { 2064, "EBCDIC-AT-DE" },
338 { 2065, "EBCDIC-AT-DE-A" },
339 { 2066, "EBCDIC-CA-FR" },
340 { 2067, "EBCDIC-DK-NO" },
341 { 2068, "EBCDIC-DK-NO-A" },
342 { 2069, "EBCDIC-FI-SE" },
343 { 2070, "EBCDIC-FI-SE-A" },
344 { 2071, "EBCDIC-FR" },
345 { 2072, "EBCDIC-IT" },
346 { 2073, "EBCDIC-PT" },
347 { 2074, "EBCDIC-ES" },
348 { 2075, "EBCDIC-ES-A" },
349 { 2076, "EBCDIC-ES-S" },
350 { 2077, "EBCDIC-UK" },
351 { 2078, "EBCDIC-US" },
352 { 2079, "UNKNOWN-8BIT" },
353 { 2080, "MNEMONIC" },
358 { 2085, "HZ-GB-2312" },
362 { 2089, "IBM00858" },
363 { 2090, "IBM00924" },
364 { 2091, "IBM01140" },
365 { 2092, "IBM01141" },
366 { 2093, "IBM01142" },
367 { 2094, "IBM01143" },
368 { 2095, "IBM01144" },
369 { 2096, "IBM01145" },
370 { 2097, "IBM01146" },
371 { 2098, "IBM01147" },
372 { 2099, "IBM01148" },
373 { 2100, "IBM01149" },
374 { 2101, "Big5-HKSCS" },
377 { 2104, "Amiga-1251" },
378 { 2105, "KOI7-switched" },
382 { 2109, "windows-874" },
384 { 2250, "windows-1250" },
385 { 2251, "windows-1251" },
386 { 2252, "windows-1252" },
387 { 2253, "windows-1253" },
388 { 2254, "windows-1254" },
389 { 2255, "windows-1255" },
390 { 2256, "windows-1256" },
391 { 2257, "windows-1257" },
392 { 2258, "windows-1258" },
397 value_string_ext mibenum_vals_character_sets_ext = VALUE_STRING_EXT_INIT(mibenum_vals_character_sets);
400 * Editor modelines - http://www.wireshark.org/tools/modelines.html
405 * indent-tabs-mode: nil
408 * vi: set shiftwidth=4 tabstop=8 expandtab:
409 * :indentSize=4:tabSize=8:noTabs=true: