From cb1cb946d39b29938c9578881a8a121c5f8519f2 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Mon, 9 Dec 2013 20:46:27 +0000 Subject: From Jakub support DVB-SI character tables (EN 300 468) in a generic way From me move things to charsets.c/.h distinguish between single and multi byte encoding for some tables (so that the highlighted bytes match the displayed value) no character table byte -> length 0, use default table svn path=/trunk/; revision=53886 --- epan/charsets.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'epan/charsets.h') diff --git a/epan/charsets.h b/epan/charsets.h index 7997ffefa7..42747518af 100644 --- a/epan/charsets.h +++ b/epan/charsets.h @@ -26,10 +26,62 @@ #include "ws_symbol_export.h" +#include +#include + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +typedef enum { + DVB_ENCODING_INVALID = -3, /* length invalid */ + DVB_ENCODING_RESERVED = -2, /* reserved by spec */ + + DVB_ENCODING_UNKNOWN = -1, /* not defined by spec */ + + DVB_ENCODING_LATIN = 0, + DVB_ENCODING_ISO_8859_5, + DVB_ENCODING_ISO_8859_6, + DVB_ENCODING_ISO_8859_7, + DVB_ENCODING_ISO_8859_8, + DVB_ENCODING_ISO_8859_9, + DVB_ENCODING_ISO_8859_10, + DVB_ENCODING_ISO_8859_11, + /* 0x08 is reserved */ + DVB_ENCODING_ISO_8859_13 = 9, + DVB_ENCODING_ISO_8859_14, + DVB_ENCODING_ISO_8859_15, + + /* TODO: 0x11...0x15 */ + + DVB_ENCODING_EXT_BASE = 0x100000, + DVB_ENCODING_EXT_ISO_8859_1 = DVB_ENCODING_EXT_BASE | 1, + DVB_ENCODING_EXT_ISO_8859_2 = DVB_ENCODING_EXT_BASE | 2, + DVB_ENCODING_EXT_ISO_8859_3 = DVB_ENCODING_EXT_BASE | 3, + DVB_ENCODING_EXT_ISO_8859_4 = DVB_ENCODING_EXT_BASE | 4, + DVB_ENCODING_EXT_ISO_8859_5 = DVB_ENCODING_EXT_BASE | 5, + DVB_ENCODING_EXT_ISO_8859_6 = DVB_ENCODING_EXT_BASE | 6, + DVB_ENCODING_EXT_ISO_8859_7 = DVB_ENCODING_EXT_BASE | 7, + DVB_ENCODING_EXT_ISO_8859_8 = DVB_ENCODING_EXT_BASE | 8, + DVB_ENCODING_EXT_ISO_8859_9 = DVB_ENCODING_EXT_BASE | 9, + DVB_ENCODING_EXT_ISO_8859_10 = DVB_ENCODING_EXT_BASE | 10, + DVB_ENCODING_EXT_ISO_8859_11 = DVB_ENCODING_EXT_BASE | 11, + /* DVB_ENCODING_ISO_8859_12 = DVB_ENCODING_EXT_BASE | 12 */ + DVB_ENCODING_EXT_ISO_8859_13 = DVB_ENCODING_EXT_BASE | 13, + DVB_ENCODING_EXT_ISO_8859_14 = DVB_ENCODING_EXT_BASE | 14, + DVB_ENCODING_EXT_ISO_8859_15 = DVB_ENCODING_EXT_BASE | 15, +} dvb_encoding_e; + +extern const value_string dvb_string_encoding_vals[]; + +WS_DLL_PUBLIC +guint dvb_analyze_string_charset(tvbuff_t *tvb, int offset, int length, + dvb_encoding_e *encoding); + +WS_DLL_PUBLIC +guint dvb_enc_to_item_enc(dvb_encoding_e encoding); + + #if 0 void ASCII_to_EBCDIC(guint8 *buf, guint bytes); guint8 ASCII_to_EBCDIC1(guint8 c); -- cgit v1.2.3