gsm_cbs: sabp: Display Unicode messages

The broadcast message page content is always converted to UTF-8 in the
dissect_cbs_data function using tvb_get_string_enc(...)

Change-Id: I5fe3d421917b38ccb07438f01f3c4d4ea8cbd787
Reviewed-on: https://code.wireshark.org/review/22315
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Vasil Velichkov 2017-06-21 21:14:01 +03:00 committed by Anders Broman
parent 123d170767
commit 9a87f80f09
3 changed files with 9 additions and 9 deletions

View File

@ -240,7 +240,7 @@ void proto_register_sabp(void) {
NULL, HFILL }},
{ &hf_sabp_cbs_page_content,
{ "CBS Page Content", "sabp.cb_page_content",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_sabp_cb_inf_len,
{ "CBS-Message-Information-Length", "sabp.cb_inf_len",

View File

@ -326,11 +326,11 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *cbs_page_subtree = proto_tree_add_subtree(cbs_page_tree, tvb, offset, -1,
ett_gsm_cbs_page_content, NULL, "Cell Broadcast Page Contents");
len = tvb_reported_length(cbs_page_tvb);
proto_tree_add_item(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0, text_len, ENC_ASCII|ENC_NA);
proto_tree_add_item(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0, text_len, ENC_UTF_8|ENC_NA);
len -= text_len;
if (len)
{
proto_tree_add_item(cbs_page_subtree, hf_gsm_cbs_page_content_padding, cbs_page_tvb, text_len, len, ENC_ASCII|ENC_NA);
proto_tree_add_item(cbs_page_subtree, hf_gsm_cbs_page_content_padding, cbs_page_tvb, text_len, len, ENC_UTF_8|ENC_NA);
}
}
if (text_len)
@ -366,7 +366,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
cbs_msg_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, cbs_msg_tvb, 0, len, "GSM Cell Broadcast Message");
cbs_msg_tree = proto_item_add_subtree(cbs_msg_item, ett_cbs_msg);
proto_tree_add_item(cbs_msg_tree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, len, ENC_ASCII|ENC_NA);
proto_tree_add_item(cbs_msg_tree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, len, ENC_UTF_8|ENC_NA);
}
return tvb_captured_length(tvb);
@ -398,7 +398,7 @@ int dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, proto
msg_len = tvb_reported_length(cbs_msg_tvb);
cbs_subtree = proto_tree_add_subtree_format(cbs_tree, tvb, offset, -1,
ett_cbs_msg, NULL, "Cell Broadcast Message Contents (length: %d)", msg_len);
msg = tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII);
msg = tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_UTF_8|ENC_NA);
proto_tree_add_string_format(cbs_subtree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, -1, msg, "%s", msg);
return tvb_captured_length(tvb);
}
@ -520,21 +520,21 @@ proto_register_cbs(void)
{ &hf_gsm_cbs_page_content,
{ "CBS Page Content",
"gsm_cbs.page_content",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_STRING, STR_UNICODE, NULL, 0x0,
NULL, HFILL
}
},
{ &hf_gsm_cbs_page_content_padding,
{ "CBS Page Content Padding",
"gsm_cbs.page_content_padding",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_STRING, STR_UNICODE, NULL, 0x0,
NULL, HFILL
}
},
{ &hf_gsm_cbs_message_content,
{ "CBS Message Content",
"gsm_cbs.message_content",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_STRING, STR_UNICODE, NULL, 0x0,
NULL, HFILL
}
}

View File

@ -1877,7 +1877,7 @@ void proto_register_sabp(void) {
NULL, HFILL }},
{ &hf_sabp_cbs_page_content,
{ "CBS Page Content", "sabp.cb_page_content",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_sabp_cb_inf_len,
{ "CBS-Message-Information-Length", "sabp.cb_inf_len",