Use tvb_get_string_enc(..., ENC_ASCII|ENC_NA) for 8-bit encoding.

If there are 8-bit "extended ASCII" encodings, either one should be
wired in or there should be a preference for them.

Change-Id: Id62381b2579e8edf3719bd92959821c21f7ba223
Reviewed-on: https://code.wireshark.org/review/402
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-02-26 02:12:53 -08:00
parent 985d334f9b
commit 85885f4509
1 changed files with 6 additions and 2 deletions

View File

@ -271,9 +271,13 @@ tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree
case SMS_ENCODING_8BIT:
/*
* XXX - encoding is "user-defined". Use ASCII?
* XXX - encoding is "user-defined". Have a preference?
*/
tvb_out = tvb_new_subset(tvb, offset, length, length);
utf8_text = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII|ENC_NA);
utf8_out = g_strdup(utf8_text);
tvb_out = tvb_new_child_real_data(tvb, utf8_out, (guint)strlen(utf8_out), (guint)strlen(utf8_out));
tvb_set_free_cb(tvb_out, g_free);
add_new_data_source(pinfo, tvb_out, "unpacked 7 bit data");
break;
case SMS_ENCODING_UCS2: