aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gadu-gadu.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-19 14:32:24 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-19 14:32:24 +0000
commit85aad383470b677d8aa2e340536afe917d9c9907 (patch)
treef53c0486dfcd60b49fe337935db69292996a71d9 /epan/dissectors/packet-gadu-gadu.c
parent7c59ac028086d017ad82498ed1acafcb4ed0c05b (diff)
Add proto_tree_add_unicode_string() to add UTF-8 string to tree.
Convert some proto_tree_add_string_format_value(..., val, "%s", val); to use new function. svn path=/trunk/; revision=43363
Diffstat (limited to 'epan/dissectors/packet-gadu-gadu.c')
-rw-r--r--epan/dissectors/packet-gadu-gadu.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/epan/dissectors/packet-gadu-gadu.c b/epan/dissectors/packet-gadu-gadu.c
index 69d9a531ce..b8447740a2 100644
--- a/epan/dissectors/packet-gadu-gadu.c
+++ b/epan/dissectors/packet-gadu-gadu.c
@@ -434,12 +434,7 @@ dissect_gadu_gadu_stringz_cp1250(tvbuff_t *tvb, int hfindex, proto_tree *tree, i
if (len > 0)
offset++; /* NUL */
- /* proto_item_fill_label() is broken for UTF-8 strings.
- * It's using internally format_text() which doesn't support UTF-8
- *
- * So don't use proto_tree_add_string() but proto_tree_add_string_format_value()
- */
- proto_tree_add_string_format_value(tree, hfindex, tvb, org_offset, offset - org_offset, str->str, "%s", str->str);
+ proto_tree_add_unicode_string(tree, hfindex, tvb, org_offset, offset - org_offset, str->str);
g_string_free(str, TRUE);
return offset;
@@ -457,7 +452,9 @@ dissect_gadu_gadu_uint32_string_utf8(tvbuff_t *tvb, int hfindex, proto_tree *tre
offset += 4;
if (len > 0) {
- /* The one below doesn't work, same reason like in dissect_gadu_gadu_stringz_cp1250() */
+ /* proto_item_fill_label() is broken for UTF-8 strings.
+ * It's using internally format_text() which doesn't support UTF-8
+ */
/* proto_tree_add_item(tree, hfindex, tvb, offset, len, ENC_UTF_8|ENC_NA); */
/* Use workaround */
@@ -468,7 +465,7 @@ dissect_gadu_gadu_uint32_string_utf8(tvbuff_t *tvb, int hfindex, proto_tree *tre
offset += len;
- proto_tree_add_string_format_value(tree, hfindex, tvb, org_offset, offset - org_offset, str, "%s", str);
+ proto_tree_add_unicode_string(tree, hfindex, tvb, org_offset, offset - org_offset, str);
return offset;
}