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 <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2019-07-14 19:46:31 -07:00
parent e5efd68d3b
commit 258a5f6a17
1 changed files with 10 additions and 2 deletions

View File

@ -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;