diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-07-03 01:40:12 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-07-03 01:40:12 +0000 |
commit | ae7f40cbfc88d97d8b04fd9c27e33187df67be0e (patch) | |
tree | 63652eee0c3ea95cc040a876756ad2bcebf4c6e3 /epan/proto.c | |
parent | 16fabcc02c79bf318854e6a3063ba344a4656619 (diff) |
Add ENC_ values for UTF-8 and EBCDIC, support them for FT_STRINGZ
values, and use them in the MQ dissector, so EBCDIC strings are
displayed as such.
Fix up some other final arguments to proto_tree_add_item().
svn path=/trunk/; revision=37872
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c index 1ecee43159..51afa5ab06 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1466,6 +1466,8 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, string_writable = ep_alloc(length); tvb_memcpy(tvb, string_writable, start, length); + if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) + EBCDIC_to_ASCII(string_writable, length); string = string_writable; } else if (length == 0) { string = "[Empty]"; @@ -1501,7 +1503,12 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, * we made string values counted * rather than null-terminated.) */ - string = tvb_get_ephemeral_string(tvb, start, length); + gchar *string_writable; + + string_writable = tvb_get_ephemeral_string(tvb, start, length); + if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) + EBCDIC_to_ASCII(string_writable, length); + string = string_writable; } new_fi->length = length; proto_tree_set_string(new_fi, string); |