diff options
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); |