This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Display a string coded in UTF-16

0

Hi.

I am trying to patch a home made plugin. To summarize, a xml file describes message format and the plugin manages to decode the messages.

I have some messages containing some string coded in UTF-8. It works fine. I just have to write in my xml that I have to decode a FT_STRING .

Now, I have some new messages that are coded in UTF-16 If I use a FT_STRING, it just prints the first character (stop at the first 000 encountered)

The plugin calls proto_tree_add_item. I dont't find any other type that FT_STRING that could support UTF-16 I am using 1.6.0rc2 I can use a more recent version if needed.

Thanks

asked 09 Jan '12, 01:34

blinde's gravatar image

blinde
6224
accept rate: 0%


One Answer:

0

As glib internaly uses UTF-8 encoding you will have to convert the string yourself tvb_get_unicode_string() or tvb_get_ephemeral_unicode_string() may be of help or use somting from http://developer.gnome.org/glib/stable/glib-Character-Set-Conversion.html Regards Anders

answered 09 Jan '12, 22:39

Anders's gravatar image

Anders ♦
4.6k952
accept rate: 17%