diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2013-12-15 19:13:31 +0000 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2013-12-15 19:13:31 +0000 |
commit | a07c0ff1465960410089015fd91f42fac49461ac (patch) | |
tree | d976b133a1ee60cc8925ead93e8a068e544746d1 | |
parent | 93594d61b2ddf737c5f36f408c1cde22e4fd23b6 (diff) |
add support for ISO 8859-5
svn path=/trunk/; revision=54132
-rw-r--r-- | epan/charsets.c | 20 | ||||
-rw-r--r-- | epan/charsets.h | 1 | ||||
-rw-r--r-- | epan/proto.h | 1 | ||||
-rw-r--r-- | epan/tvbuff.c | 8 |
4 files changed, 30 insertions, 0 deletions
diff --git a/epan/charsets.c b/epan/charsets.c index 3dee3a2ec0..6c75a01287 100644 --- a/epan/charsets.c +++ b/epan/charsets.c @@ -197,6 +197,26 @@ const gunichar2 charset_table_iso_8859_2[0x80] = { 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 /* - 0xFF */ }; +/* ISO-8859-5 (http://en.wikipedia.org/wiki/ISO/IEC_8859-5#Code_page_layout) */ +const gunichar2 charset_table_iso_8859_5[0x80] = { + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, /* 0x80 - */ + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, /* - 0x8F */ + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, /* 0x90 - */ + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, /* - 0x9F */ + 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, /* 0xA0 - */ + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x040d, 0x040e, 0x040f, /* - 0xAF */ + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, /* 0xB0 - */ + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, /* - 0xBF */ + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, /* 0xC0 - */ + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, /* - 0xCF */ + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, /* 0xD0 - */ + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, /* - 0xDF */ + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, /* 0xE0 - */ + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, /* - 0xEF */ + 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, /* 0xF0 - */ + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f /* - 0xFF */ +}; + /* Windows-1250 (http://en.wikipedia.org/wiki/Windows-1250) */ const gunichar2 charset_table_cp1250[0x80] = { 0x20ac, UNREPL, 0x201a, UNREPL, 0x201e, 0x2026, 0x2020, 0x2021, /* 0x80 - */ diff --git a/epan/charsets.h b/epan/charsets.h index 19ea1676c4..3e076ec91a 100644 --- a/epan/charsets.h +++ b/epan/charsets.h @@ -50,6 +50,7 @@ extern const gunichar2 charset_table_cp1250[0x80]; /* Tables for ISO-8859-X */ extern const gunichar2 charset_table_iso_8859_2[0x80]; +extern const gunichar2 charset_table_iso_8859_5[0x80]; #ifdef __cplusplus } diff --git a/epan/proto.h b/epan/proto.h index 2085ec5e49..0e408f6f8c 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -287,6 +287,7 @@ WS_DLL_PUBLIC WS_MSVC_NORETURN void proto_report_dissector_bug(const char *messa #define ENC_WINDOWS_1250 0x0000000A #define ENC_ISO_8859_1 0x0000000C #define ENC_ISO_8859_2 0x0000000E +#define ENC_ISO_8859_5 0x00000014 /* * TODO: diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 421b55662c..39f8bb59d0 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1957,6 +1957,10 @@ tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, strbuf = tvb_get_string_unichar2(scope, tvb, offset, length, charset_table_iso_8859_2); break; + case ENC_ISO_8859_5: + strbuf = tvb_get_string_unichar2(scope, tvb, offset, length, charset_table_iso_8859_5); + break; + case ENC_UTF_8: /* * XXX - should map all invalid UTF-8 sequences @@ -2096,6 +2100,10 @@ tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, g strptr = tvb_get_stringz_unichar2(scope, tvb, offset, lengthp, charset_table_iso_8859_2); break; + case ENC_ISO_8859_5: + strptr = tvb_get_stringz_unichar2(scope, tvb, offset, lengthp, charset_table_iso_8859_5); + break; + case ENC_UTF_8: /* * XXX - should map all invalid UTF-8 sequences |