path: root/epan/charsets.h
diff options
authorGuy Harris <guy@alum.mit.edu>2016-12-11 21:49:14 -0800
committerGuy Harris <guy@alum.mit.edu>2016-12-12 05:49:50 +0000
commit4d47c9a84144510a33747801cf4ef65f1b3da422 (patch)
tree8b6f3a7651c209b7ec634f78292b432b7f6cda66 /epan/charsets.h
parent6bc65121287e585d06755b3406c571ad9ba4d766 (diff)
Fix handling of EBCDIC string fields.
Have a routine that takes a 256-element translation table and uses it to map various flavors of EBCDIC to Unicode. Have separate translation tables for "common" EBCDIC (everything that's the same in all EBCDIC code pages that include the original EBCDIC characters) and EBCDIC code page 037. Add ENC_EBCDIC_CP037 for code page 037. Change-Id: Ia882b3c0abef9e30eb54cd47396e6fa0d6342044 Reviewed-on: https://code.wireshark.org/review/19212 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/charsets.h')
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/charsets.h b/epan/charsets.h
index 407d0726be..6d54d42fa6 100644
--- a/epan/charsets.h
+++ b/epan/charsets.h
@@ -59,6 +59,10 @@ extern const gunichar2 charset_table_mac_roman[0x80];
/* Tables for DOS code pages */
extern const gunichar2 charset_table_cp437[0x80];
+/* Tables for EBCDIC code pages */
+extern const gunichar2 charset_table_ebcdic[256];
+extern const gunichar2 charset_table_ebcdic_cp037[256];
* Given a wmem scope, a pointer, and a length, treat the string of bytes
* referred to by the pointer and length as an ASCII string, with all bytes
@@ -95,7 +99,7 @@ get_ascii_7bits_string(wmem_allocator_t *scope, const guint8 *ptr,
const gint bit_offset, gint no_of_chars);
WS_DLL_PUBLIC guint8 *
-get_ebcdic_string(wmem_allocator_t *scope, const guint8 *ptr, gint length);
+get_ebcdic_unichar2_string(wmem_allocator_t *scope, const guint8 *ptr, gint length, const gunichar2 table[256]);
WS_DLL_PUBLIC guint8 *
get_t61_string(wmem_allocator_t *scope, const guint8 *ptr, gint length);