summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-xml.c')
-rw-r--r--epan/dissectors/packet-xml.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index cf857d947d..9a28a1f727 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -238,7 +238,8 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
dissect_xml(tvb, pinfo, tree);
return TRUE;
} else if (pref_heuristic_unicode) {
- const guint8 *data_str = tvb_get_unicode_string(NULL, tvb, 0, tvb_length(tvb), ENC_LITTLE_ENDIAN);
+ /* XXX - UCS-2, or UTF-16? */
+ const guint8 *data_str = tvb_get_string_enc(NULL, tvb, 0, tvb_length(tvb), ENC_UCS_2|ENC_LITTLE_ENDIAN);
tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_length(tvb)/2, tvb_length(tvb)/2);
tvb_set_free_cb(unicode_tvb, g_free);
if (tvbparse_peek(tvbparse_init(unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
@@ -1476,8 +1477,9 @@ proto_register_xml(void)
prefs_register_bool_preference(xml_module, "heuristic_udp", "Use Heuristics for UDP",
"Try to recognize XML for unknown UDP ports",
&pref_heuristic_udp);
+ /* XXX - UCS-2, or UTF-16? */
prefs_register_bool_preference(xml_module, "heuristic_unicode", "Use Unicode in heuristics",
- "Try to recognize XML encoded in Unicode (UCS-2)",
+ "Try to recognize XML encoded in Unicode (UCS-2BE)",
&pref_heuristic_unicode);
g_array_free(ett_arr, TRUE);