diff options
-rw-r--r-- | asn1/gsm_map/gsm_map.cnf | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-ansi_637.c | 54 | ||||
-rw-r--r-- | epan/dissectors/packet-etsi_card_app_toolkit.c | 17 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_map.c | 58 | ||||
-rw-r--r-- | epan/dissectors/packet-mbim.c | 31 |
5 files changed, 40 insertions, 140 deletions
diff --git a/asn1/gsm_map/gsm_map.cnf b/asn1/gsm_map/gsm_map.cnf index 08487c8404..e74dac9b61 100644 --- a/asn1/gsm_map/gsm_map.cnf +++ b/asn1/gsm_map/gsm_map.cnf @@ -499,8 +499,6 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; */ static unsigned char msgbuf[1024]; gchar *utf8_text = NULL; - GIConv cd; - GError *l_conv_error = NULL; %(DEFAULT_BODY)s if (!parameter_tvb) @@ -519,24 +517,12 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %%s", utf8_text); break; case SMS_ENCODING_8BIT: - proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, length)); + /* XXX - ASCII, or some extended ASCII? */ + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_ASCII|ENC_NA)); break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(parameter_tvb, 0, length), length, cd, NULL, NULL, &l_conv_error); - if(!l_conv_error) - proto_tree_add_text(tree, tvb, 0, length, "USSD String: %%s", utf8_text); - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_convert_with_iconv FAILED"); - - g_free(utf8_text); - g_iconv_close(cd); - } - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_iconv_open FAILED contact wireshark"); - + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN)); break; default: break; diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c index 2da3ca8c1c..ef5e3210dc 100644 --- a/epan/dissectors/packet-ansi_637.c +++ b/epan/dissectors/packet-ansi_637.c @@ -684,22 +684,8 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, OTHER, &bit, &udh_fields); } - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, required_octs), required_octs , cd , NULL , NULL , &l_conv_error); - if (!l_conv_error) - { - proto_tree_add_string(tree, hf_ansi_637_tele_user_data_text, - tvb_out, offset, required_octs, utf8_text); - } - else - { - proto_tree_add_text(tree, tvb_out, offset, required_octs, "%s", "Failed on UCS-2BE contact Wireshark developers"); - } - if (utf8_text) - g_free(utf8_text); - g_iconv_close(cd); - } + proto_tree_add_item(tree, hf_ansi_637_tele_user_data_text, + tvb_out, offset, num_fields*2, ENC_UCS_2|ENC_BIG_ENDIAN); } else if (encoding == 0x07)/* Latin/Hebrew */ { @@ -720,22 +706,8 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, OTHER, &bit, &udh_fields); } - if ((cd = g_iconv_open("UTF-8","iso-8859-8")) != (GIConv)-1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, num_fields), num_fields , cd , NULL , NULL , &l_conv_error); - if (!l_conv_error) - { - proto_tree_add_string(tree, hf_ansi_637_tele_user_data_text, - tvb_out, offset, num_fields, utf8_text); - } - else - { - proto_tree_add_text(tree, tvb_out, offset, num_fields, "%s", "Failed on iso-8859-8 contact Wireshark developers"); - } - if (utf8_text) - g_free(utf8_text); - g_iconv_close(cd); - } + proto_tree_add_item(tree, hf_ansi_637_tele_user_data_text, + tvb_out, offset, num_fields, ENC_ISO_8859_8|ENC_NA); } else if (encoding == 0x08) /* ISO 8859-1 (a/k/a ISO Latin 1) */ { @@ -756,22 +728,8 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, OTHER, &bit, &udh_fields); } - if ((cd = g_iconv_open("UTF-8","iso-8859-1")) != (GIConv)-1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, num_fields) , num_fields , cd , NULL , NULL , &l_conv_error); - if (!l_conv_error) - { - proto_tree_add_string(tree, hf_ansi_637_tele_user_data_text, - tvb_out, offset, num_fields, utf8_text); - } - else - { - proto_tree_add_text(tree, tvb_out, offset, num_fields, "%s", "Failed on iso-8859-1 contact Wireshark developers"); - } - if (utf8_text) - g_free(utf8_text); - g_iconv_close(cd); - } + proto_tree_add_item(tree, hf_ansi_637_tele_user_data_text, + tvb_out, offset, num_fields, ENC_ISO_8859_1|ENC_NA); } else if (encoding == 0x09) /* GSM 7-bit default alphabet */ { diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c index 182700b899..a4ba641ef5 100644 --- a/epan/dissectors/packet-etsi_card_app_toolkit.c +++ b/epan/dissectors/packet-etsi_card_app_toolkit.c @@ -1076,24 +1076,11 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } break; case 0x04: /* 8bit */ + /* XXX - ASCII, or some extended ASCII? */ proto_tree_add_item(elem_tree, hf_ctlv_text_string, tvb, pos+1, len-1, ENC_ASCII|ENC_NA); break; case 0x08: /* UCS2 */ - { - GIConv cd; - GError *l_conv_error = NULL; - gchar *utf8_text; - - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1) { - utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb, pos+1, len-1), len-1, cd, NULL, NULL, &l_conv_error); - if(!l_conv_error) { - proto_tree_add_string(elem_tree, hf_ctlv_text_string, tvb, - pos+1, len-1, utf8_text); - } else { - proto_tree_add_text(elem_tree, tvb, pos+1, len-1, "Failed to decode UCS2"); - } - } - } + proto_tree_add_item(elem_tree, hf_ctlv_text_string, tvb, pos+1, len-1, ENC_UCS_2|ENC_BIG_ENDIAN); break; default: break; diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index d68a38d194..bf44cae516 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -3546,7 +3546,7 @@ static const ber_sequence_t gsm_map_ExternalSignalInfo_sequence[] = { int dissect_gsm_map_ExternalSignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 778 "../../asn1/gsm_map/gsm_map.cnf" +#line 764 "../../asn1/gsm_map/gsm_map.cnf" /* -- Information about the internal structure is given in -- clause 7.6.9. @@ -3762,7 +3762,7 @@ dissect_gsm_map_AlertingPattern(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in int dissect_gsm_map_GSN_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 603 "../../asn1/gsm_map/gsm_map.cnf" +#line 589 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; guint8 octet; @@ -3913,7 +3913,7 @@ dissect_gsm_map_HLR_List(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse int dissect_gsm_map_GlobalCellId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 858 "../../asn1/gsm_map/gsm_map.cnf" +#line 844 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4190,7 +4190,7 @@ dissect_gsm_map_TA_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ int dissect_gsm_map_RAIdentity(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 627 "../../asn1/gsm_map/gsm_map.cnf" +#line 613 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4238,7 +4238,7 @@ dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(gboolean implicit_tag _U_ int dissect_gsm_map_LAIFixedLength(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 639 "../../asn1/gsm_map/gsm_map.cnf" +#line 625 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4531,7 +4531,7 @@ dissect_gsm_map_ss_ForwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); -#line 546 "../../asn1/gsm_map/gsm_map.cnf" +#line 532 "../../asn1/gsm_map/gsm_map.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN); @@ -4886,8 +4886,6 @@ dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int */ static unsigned char msgbuf[1024]; gchar *utf8_text = NULL; - GIConv cd; - GError *l_conv_error = NULL; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶meter_tvb); @@ -4908,24 +4906,12 @@ dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %s", utf8_text); break; case SMS_ENCODING_8BIT: - proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, length)); + /* XXX - ASCII, or some extended ASCII? */ + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_ASCII|ENC_NA)); break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(parameter_tvb, 0, length), length, cd, NULL, NULL, &l_conv_error); - if(!l_conv_error) - proto_tree_add_text(tree, tvb, 0, length, "USSD String: %s", utf8_text); - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_convert_with_iconv FAILED"); - - g_free(utf8_text); - g_iconv_close(cd); - } - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_iconv_open FAILED contact wireshark"); - + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN)); break; default: break; @@ -8493,7 +8479,7 @@ dissect_gsm_map_ms_SGSN_Capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 892 "../../asn1/gsm_map/gsm_map.cnf" +#line 878 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; int length, name_len, tmp; @@ -8740,7 +8726,7 @@ dissect_gsm_map_ms_UpdateGprsLocationRes(gboolean implicit_tag _U_, tvbuff_t *tv static int dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 675 "../../asn1/gsm_map/gsm_map.cnf" +#line 661 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -8763,7 +8749,7 @@ dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvb static int dissect_gsm_map_ms_EncryptionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 687 "../../asn1/gsm_map/gsm_map.cnf" +#line 673 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -8848,7 +8834,7 @@ dissect_gsm_map_ms_AllowedUMTS_Algorithms(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RadioResourceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 651 "../../asn1/gsm_map/gsm_map.cnf" +#line 637 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -8919,7 +8905,7 @@ dissect_gsm_map_ms_BSSMAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RANAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 663 "../../asn1/gsm_map/gsm_map.cnf" +#line 649 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -9865,7 +9851,7 @@ static int dissect_gsm_map_ms_T_forwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_gsm_map_ms_Ext_ForwOptions(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 552 "../../asn1/gsm_map/gsm_map.cnf" +#line 538 "../../asn1/gsm_map/gsm_map.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN); @@ -11028,7 +11014,7 @@ dissect_gsm_map_ms_VlrCamelSubscriptionInfo(gboolean implicit_tag _U_, tvbuff_t static int dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 560 "../../asn1/gsm_map/gsm_map.cnf" +#line 546 "../../asn1/gsm_map/gsm_map.cnf" guint8 pdp_type_org; tvbuff_t *parameter_tvb; @@ -11061,7 +11047,7 @@ dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of int dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 582 "../../asn1/gsm_map/gsm_map.cnf" +#line 568 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; @@ -11083,7 +11069,7 @@ dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_gsm_map_ms_Ext_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 593 "../../asn1/gsm_map/gsm_map.cnf" +#line 579 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; @@ -12586,7 +12572,7 @@ dissect_gsm_map_ms_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t * static int dissect_gsm_map_ms_LocationNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 919 "../../asn1/gsm_map/gsm_map.cnf" +#line 905 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; const char *digit_str; @@ -15437,7 +15423,7 @@ dissect_gsm_map_lcs_ProvideSubscriberLocation_Arg(gboolean implicit_tag _U_, tvb int dissect_gsm_map_lcs_Ext_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 870 "../../asn1/gsm_map/gsm_map.cnf" +#line 856 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -16863,7 +16849,7 @@ static const ber_sequence_t gsm_old_Bss_APDU_sequence[] = { static int dissect_gsm_old_Bss_APDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 700 "../../asn1/gsm_map/gsm_map.cnf" +#line 686 "../../asn1/gsm_map/gsm_map.cnf" guint8 octet; guint8 length; tvbuff_t *next_tvb; @@ -18410,7 +18396,7 @@ dissect_gsm_ss_LCS_PeriodicLocationCancellationArg(gboolean implicit_tag _U_, tv static int dissect_gsm_map_ericsson_T_locationInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 948 "../../asn1/gsm_map/gsm_map.cnf" +#line 934 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; guint8 rat; diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c index 26594d3ad4..577380b07b 100644 --- a/epan/dissectors/packet-mbim.c +++ b/epan/dissectors/packet-mbim.c @@ -3032,8 +3032,6 @@ mbim_dissect_set_ussd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint tvbuff_t *ussd_tvb; int out_len; gchar *utf8_text; - GIConv cd; - GError *l_conv_error; base_offset = offset; proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_action, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -3065,21 +3063,14 @@ mbim_dissect_set_ussd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint ussd_tvb, 0, ussd_payload_length, utf8_text); break; case SMS_ENCODING_8BIT: + /* XXX - ASCII, or some extended ASCII? */ proto_tree_add_item(subtree, hf_mbim_set_ussd_ussd_ussd_payload_text, ussd_tvb , 0, ussd_payload_length, ENC_ASCII|ENC_NA); break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) { - utf8_text = g_convert_with_iconv(tvb_get_ptr(ussd_tvb, 0, ussd_payload_length), - ussd_payload_length, cd, NULL, NULL, &l_conv_error); - if (!l_conv_error) { - proto_tree_add_string(subtree, hf_mbim_set_ussd_ussd_ussd_payload_text, - ussd_tvb, 0, ussd_payload_length, utf8_text); - } - g_free(utf8_text); - g_iconv_close(cd); - } + proto_tree_add_item(subtree, hf_mbim_set_ussd_ussd_ussd_payload_text, + ussd_tvb , 0, ussd_payload_length, ENC_UCS_2|ENC_BIG_ENDIAN); break; default: break; @@ -3098,8 +3089,6 @@ mbim_dissect_ussd_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint tvbuff_t *ussd_tvb; int out_len; gchar *utf8_text; - GIConv cd; - GError *l_conv_error; base_offset = offset; proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_response, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -3132,20 +3121,14 @@ mbim_dissect_ussd_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text); break; case SMS_ENCODING_8BIT: + /* XXX - ASCII, or some extended ASCII? */ proto_tree_add_text(subtree, ussd_tvb , 0, ussd_payload_length, "%s", - tvb_get_string(wmem_packet_scope(), ussd_tvb, 0, ussd_payload_length)); + tvb_get_string_enc(wmem_packet_scope(), ussd_tvb, 0, ussd_payload_length, ENC_ASCII|ENC_NA)); break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) { - utf8_text = g_convert_with_iconv(tvb_get_ptr(ussd_tvb, 0, ussd_payload_length), - ussd_payload_length, cd, NULL, NULL, &l_conv_error); - if (!l_conv_error) { - proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text); - } - g_free(utf8_text); - g_iconv_close(cd); - } + proto_tree_add_text(subtree, ussd_tvb , 0, ussd_payload_length, "%s", + tvb_get_string_enc(wmem_packet_scope(), ussd_tvb, 0, ussd_payload_length, ENC_UCS_2|ENC_BIG_ENDIAN)); break; default: break; |