Wireshark mailing list archives
Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script.
From: Bill Meier <wmeier () newsguy com>
Date: Mon, 10 Oct 2011 14:44:23 -0400
On 10/4/2011 2:45 PM, Guy Harris wrote:
... FT_STRING, FT_STRINGZ, and FT_UINT_STRING, for which an encoding should also be supplied. The endianness is irrelevant for ENC_UTF_8, ENC_ASCII, and ENC_EBCDIC.
> In the future, there will be ENC_UTF_16 and possibly ENC_UCS_2, for > which the endianness will be relevant. > > Should we always specify an endianness for strings, or only for those > character encodings where it's relevant?For FT_STRING..., rather than cluttering up the encoding arg with ENC_NA, I would be sightly inclined to specify endianness only where relevant.
For FT_UINT_STRING obviously ENC_[BIG|LITTLE]_... would be needed for all.However, I can understand the approach of always specifying an endianness to be consistent with other usage. After all, we're already using ENC_NA for FT_BYTES, FT_NONE & etc.
Thoughts ? -------In any case, no matter what is decided, changes will be needed for FT_STRING & etc.
Is it OK to just change all the instances with no character encoding to ENC_ASCII (with or without ENC_NA) ?
Currently: the encoding arg instance count for proto_tree_add_item() calls in epan/dissectors is as follows:
FT_STRING/FT_STRINGZ:
593 FALSE
124 TRUE
38 0
394 ENC_BIG_ENDIAN
105 ENC_LITTLE_ENDIAN
85 ENC_NA
17 ENC_ASCII|ENC_BIG_ENDIAN
1 ENC_ASCII|ENC_LITTLE_ENDIAN
25 ENC_UTF_8|ENC_BIG_ENDIAN
14 ENC_UTF_8|ENC_LITTLE_ENDIAN
2 ENC_UTF_8|ENC_NA
1 ENC_UTF_8
29 ENC_EBCDIC|ENC_NA
FT_UINT_STRING (9 or so files):
36 ENC_BIG_ENDIAN
14 ENC_LITTLE_ENDIAN
10 ENC_UTF_8|ENC_BIG_ENDIAN
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script., (continued)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. David Young (Oct 04)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 04)
- Re: [Wireshark-dev] Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Chris Maynard (Oct 05)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Anders Broman (Oct 05)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 13)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. David Young (Oct 04)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 10)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 10)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Guy Harris (Oct 10)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 12)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Guy Harris (Oct 12)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Guy Harris (Oct 12)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Dirk Jagdmann (Oct 13)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Bill Meier (Oct 13)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Guy Harris (Oct 04)
- Re: Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script. Stephen Fisher (Oct 19)
