aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_a_dtap.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-12-28 21:58:43 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-12-28 21:58:43 +0000
commitde1f8b1c0e519c192fbf79155c1fe82e21b7db32 (patch)
tree61bced93269597f33337ed4b8d84d1a48e47e8b9 /epan/dissectors/packet-gsm_a_dtap.c
parent8d872958f6df1c871989951af5d5f6330122fd0a (diff)
Replace gsm_sms_char_ascii_decode() with gsm_sms_chars_to_utf8(), which
returns an ep_allocated string (and whose name reflects that what you get out is UTF-8, not just ASCII). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31376 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-gsm_a_dtap.c')
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index 61f0f67fa7..0e8f3ae93f 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -726,23 +726,7 @@ de_network_name(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gcha
if (num_spare_bits == 7)
num_chars--;
a_bigbuf[num_chars] = '\0';
- /*
- * The documentation for g_unichar_to_utf8() says that
- * the output buffer "must have at least 6 bytes of space".
- * I think that maximum is for some Korean characters, so
- * perhaps that's overkill here, but there are at least
- * some SMS characters whose UTF-8 encoding takes 3
- * bytes. We'll be safe and allocate 6 bytes.
- *
- * XXX - we could have a routine that takes a string of
- * SMS characters and returns an ep_allocated UTF-8
- * string. g_unichar_to_utf8(), if passed a null
- * buffer pointer, just returns the number of bytes
- * required, so we could get the right buffer size
- * by making two passes over the SMS string.
- */
- net_name = ep_alloc(6 * num_chars);
- gsm_sms_char_ascii_decode(net_name, a_bigbuf, num_chars);
+ net_name = gsm_sms_chars_to_utf8(a_bigbuf, num_chars);
proto_tree_add_text(tree, tvb , curr_offset, len - 1, "Text String: %s", net_name);
break;
case 1: