| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
charsets.h
Go to the documentation of this file.
1
10#pragma once
11#include "ws_symbol_export.h"
12
13#ifdef __cplusplus
14 extern "C" {
15#endif /* __cplusplus */
16
17/*
18 * Translation tables that map the upper 128 code points in single-byte
19 * "extended ASCII" character encodings to Unicode code points in the
20 * Basic Multilingual Plane.
21 */
22
23/* Table for windows-1250 */
24 extern const gunichar2 charset_table_cp1250[0x80];
25/* Table for windows-1251 */
26 extern const gunichar2 charset_table_cp1251[0x80];
27/* Table for windows-1252 */
28 extern const gunichar2 charset_table_cp1252[0x80];
29
30/* Tables for ISO-8859-X */
31 extern const gunichar2 charset_table_iso_8859_2[0x80];
32 extern const gunichar2 charset_table_iso_8859_3[0x80];
33 extern const gunichar2 charset_table_iso_8859_4[0x80];
34 extern const gunichar2 charset_table_iso_8859_5[0x80];
35 extern const gunichar2 charset_table_iso_8859_6[0x80];
36 extern const gunichar2 charset_table_iso_8859_7[0x80];
37 extern const gunichar2 charset_table_iso_8859_8[0x80];
38 extern const gunichar2 charset_table_iso_8859_9[0x80];
39 extern const gunichar2 charset_table_iso_8859_10[0x80];
40 extern const gunichar2 charset_table_iso_8859_11[0x80];
41 extern const gunichar2 charset_table_iso_8859_13[0x80];
42 extern const gunichar2 charset_table_iso_8859_14[0x80];
43 extern const gunichar2 charset_table_iso_8859_15[0x80];
44 extern const gunichar2 charset_table_iso_8859_16[0x80];
45
46/* Tables for Mac character sets */
47 extern const gunichar2 charset_table_mac_roman[0x80];
48
49/* Tables for DOS code pages */
50 extern const gunichar2 charset_table_cp437[0x80];
51 extern const gunichar2 charset_table_cp855[0x80];
52 extern const gunichar2 charset_table_cp866[0x80];
53
54/*
55 * Translation tables that map the lower 128 code points in single-byte
56 * ISO 646-based character encodings to Unicode code points in the
57 * Basic Multilingual Plane.
58 */
59 extern const gunichar2 charset_table_iso_646_basic[0x80];
60
61/* Tables for EBCDIC code pages */
62 extern const gunichar2 charset_table_ebcdic[256];
63 extern const gunichar2 charset_table_ebcdic_cp037[256];
64 extern const gunichar2 charset_table_ebcdic_cp500[256];
65
82WS_DLL_PUBLIC uint8_t *
83 get_ascii_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
84
102WS_DLL_PUBLIC uint8_t *
103 get_utf_8_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
104
124WS_DLL_PUBLIC uint8_t *
125 get_iso_646_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[0x80]);
126
139WS_DLL_PUBLIC uint8_t *
140 get_8859_1_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
141
159WS_DLL_PUBLIC uint8_t *
160 get_unichar2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[0x80]);
161
181WS_DLL_PUBLIC uint8_t *
182 get_ucs_2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding);
183
203WS_DLL_PUBLIC uint8_t *
204 get_utf_16_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding);
205
223WS_DLL_PUBLIC uint8_t *
224 get_ucs_4_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding);
225
238WS_DLL_PUBLIC uint8_t *
239 get_ts_23_038_7bits_string_packed(wmem_allocator_t *scope, const uint8_t *ptr,
240 const size_t bit_offset, size_t no_of_chars);
241
250WS_DLL_PUBLIC uint8_t *
251 get_ts_23_038_7bits_string_unpacked(wmem_allocator_t *scope, const uint8_t *ptr,
252 size_t length);
253
262WS_DLL_PUBLIC uint8_t *
263 get_etsi_ts_102_221_annex_a_string(wmem_allocator_t *scope, const uint8_t *ptr,
264 size_t length);
265
275WS_DLL_PUBLIC uint8_t *
276 get_ascii_7bits_string(wmem_allocator_t *scope, const uint8_t *ptr,
277 const size_t bit_offset, size_t no_of_chars);
278
295WS_DLL_PUBLIC uint8_t *
296 get_nonascii_unichar2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[256]);
297
315WS_DLL_PUBLIC uint8_t *
316 get_gb18030_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
317
333WS_DLL_PUBLIC uint8_t *
334 get_euc_kr_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
335
344WS_DLL_PUBLIC uint8_t *
345 get_t61_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
346
355WS_DLL_PUBLIC uint8_t *
356 get_dect_standard_8bits_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length);
357
376WS_DLL_PUBLIC uint8_t *
377 get_string_enc_iconv(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const char *encoding);
378
379#ifdef __cplusplus
380}
381#endif /* __cplusplus */
382
383/*
384 * Editor modelines - https://www.wireshark.org/tools/modelines.html
385 *
386 * Local variables:
387 * c-basic-offset: 4
388 * tab-width: 8
389 * indent-tabs-mode: nil
390 * End:
391 *
392 * vi: set shiftwidth=4 tabstop=8 expandtab:
393 * :indentSize=4:tabSize=8:noTabs=true:
394 */
get_ascii_7bits_string
WS_DLL_PUBLIC uint8_t * get_ascii_7bits_string(wmem_allocator_t *scope, const uint8_t *ptr, const size_t bit_offset, size_t no_of_chars)
Convert a sequence of 7-bit ASCII characters to a Unicode string.
Definition charsets.c:1222
get_utf_8_string
WS_DLL_PUBLIC uint8_t * get_utf_8_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Validate and normalize a UTF‑8 byte sequence, replacing invalid sequences with the Unicode REPLACEMEN...
Definition charsets.c:114
get_8859_1_string
WS_DLL_PUBLIC uint8_t * get_8859_1_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Convert an ISO 8859/1 string to UTF‑8.
Definition charsets.c:178
get_etsi_ts_102_221_annex_a_string
WS_DLL_PUBLIC uint8_t * get_etsi_ts_102_221_annex_a_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Retrieves a string based on ETSI TS 102 221 Annex A encoding.
Definition charsets.c:1095
get_t61_string
WS_DLL_PUBLIC uint8_t * get_t61_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Converts a T.61 encoded string to a UTF-8 string.
Definition charsets.c:1829
get_ts_23_038_7bits_string_unpacked
WS_DLL_PUBLIC uint8_t * get_ts_23_038_7bits_string_unpacked(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Extracts a 7-bit string from TS 23.038 data.
Definition charsets.c:1076
get_ascii_string
WS_DLL_PUBLIC uint8_t * get_ascii_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Convert an ASCII byte sequence to a UTF‑8 string using a wmem scope.
Definition charsets.c:83
get_unichar2_string
WS_DLL_PUBLIC uint8_t * get_unichar2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[0x80])
Convert a string encoded in an extended ASCII character set to UTF‑8.
Definition charsets.c:678
get_ts_23_038_7bits_string_packed
WS_DLL_PUBLIC uint8_t * get_ts_23_038_7bits_string_packed(wmem_allocator_t *scope, const uint8_t *ptr, const size_t bit_offset, size_t no_of_chars)
Extracts a 7-bit encoded string from packed data.
Definition charsets.c:1004
get_euc_kr_string
WS_DLL_PUBLIC uint8_t * get_euc_kr_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Convert a EUC-KR encoded string to UTF-8.
Definition charsets.c:1568
get_nonascii_unichar2_string
WS_DLL_PUBLIC uint8_t * get_nonascii_unichar2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[256])
Convert a GB18030 encoded string to a UTF-8 string, substituting REPLACEMENT CHARACTER for non-ASCII ...
Definition charsets.c:1412
get_utf_16_string
WS_DLL_PUBLIC uint8_t * get_utf_16_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding)
Convert a UTF‑16 encoded string to UTF‑8.
Definition charsets.c:763
get_gb18030_string
WS_DLL_PUBLIC uint8_t * get_gb18030_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Convert a GB18030 encoded string to UTF-8.
Definition charsets.c:1536
get_ucs_2_string
WS_DLL_PUBLIC uint8_t * get_ucs_2_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding)
Convert a UCS‑2 encoded string to UTF‑8.
Definition charsets.c:711
get_iso_646_string
WS_DLL_PUBLIC uint8_t * get_iso_646_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const gunichar2 table[0x80])
Convert a string encoded in an ISO 646-based character set to UTF‑8.
Definition charsets.c:152
get_dect_standard_8bits_string
WS_DLL_PUBLIC uint8_t * get_dect_standard_8bits_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length)
Converts a DECT standard 8-bit string to a Unicode string.
Definition charsets.c:1891
get_ucs_4_string
WS_DLL_PUBLIC uint8_t * get_ucs_4_string(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, unsigned encoding)
Convert a UCS‑4 encoded string to UTF‑8.
Definition charsets.c:863
get_string_enc_iconv
WS_DLL_PUBLIC uint8_t * get_string_enc_iconv(wmem_allocator_t *scope, const uint8_t *ptr, size_t length, const char *encoding)
Convert a string in an arbitrary encoding (supported by iconv) to UTF‑8.
Definition charsets.c:1439
wmem_allocator_t
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44