From 258a5f6a173f7ae5fa9ccf9e709b22bbaa4f190b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 14 Jul 2019 19:46:31 -0700 Subject: Add support for code pages 855 and 856 for FT_STRINGZ strings. Clean up some comments while we're at it. Change-Id: I0cd014bf1d1e7dc740eac1721d5466377938655f Reviewed-on: https://code.wireshark.org/review/33939 Reviewed-by: Guy Harris --- epan/tvbuff.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'epan/tvbuff.c') diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 5d87dda873..ea9e1ffacb 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -2485,7 +2485,7 @@ tvb_format_stringzpad_wsp(wmem_allocator_t* allocator, tvbuff_t *tvb, const gint */ /* - * Given a wmem scope, tvbuff, an offset, and a length, treat the string + * Given a wmem scope, a tvbuff, an offset, and a length, treat the string * of bytes referred to by the tvbuff, offset, and length as an ASCII string, * with all bytes with the high-order bit set being invalid, and return a * pointer to a UTF-8 string, allocated using the wmem scope. @@ -2522,7 +2522,7 @@ tvb_get_utf_8_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, } /* - * Given a wmem scope, tvbuff, an offset, and a length, treat the string + * Given a wmem scope, a tvbuff, an offset, and a length, treat the string * of bytes referred to by the tvbuff, the offset, and the length as a * raw string, and return a pointer to that string, allocated using the * wmem scope. This means a null is appended at the end, but no replacement @@ -3228,6 +3228,14 @@ 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_cp437); break; + case ENC_CP855: + strptr = tvb_get_stringz_unichar2(scope, tvb, offset, lengthp, charset_table_cp855); + break; + + case ENC_CP866: + strptr = tvb_get_stringz_unichar2(scope, tvb, offset, lengthp, charset_table_cp866); + break; + case ENC_3GPP_TS_23_038_7BITS: REPORT_DISSECTOR_BUG("TS 23.038 7bits has no null character and doesn't support null-terminated strings"); break; -- cgit v1.2.3