Wireshark-bugs: [Wireshark-bugs] [Bug 6346] Lua: TvbRange missing unicode string method

Date: Fri, 16 Sep 2011 09:08:43 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6346

--- Comment #3 from Alex Vallee <avallee_30@xxxxxxxxxxx> 2011-09-16 09:08:42 PDT ---
(In reply to comment #2)
> (From update of attachment 7024 [details])
> Instead of the Boolean, you should use the proper endianness encoding:
> http://anonsvn.wireshark.org/viewvc/trunk/epan/proto.h?revision=37978&view=markup#l214
> 
> `ENC_LITTLE_ENDIAN` or `ENC_BIG_ENDIAN`
> 
> Also, why did you leave out  `_ustringz()`? Currently, we have `_string()` and
> `stringz()`.  So if you're adding `_ustring()`, I think it makes sense to add
> `_ustringz()` as well (and the same goes for the Little-Endian equivalent).

I tried adding _ustringz but it did not play nicely with the FT_STRINGZ fields.
It would only highlight the first two bytes.

As for the boolean, I was fallowing the pattern already present in 

  static int TreeItem_add_item_any(lua_State *L, gboolean little_endian)

seen at
http://anonsvn.wireshark.org/viewvc/trunk/epan/wslua/wslua_tree.c?revision=38616&view=markup

I don't see a problem in changing the _ustring_any method to take a const guint
(like the encoding parameter of tvb_get_ephemeral_unicode_string) and using
those two ENC_ constants.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.