diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2014-04-13 18:53:29 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-04-13 20:02:52 +0000 |
commit | cfe11b1097a53d5d62f1b7b9de3b816378527dae (patch) | |
tree | 77da630251ba4947d28290828b86da383c452b64 /epan/tvbuff.h | |
parent | 63ed4745a2c3abef00ec69fa1b6832674fa17605 (diff) |
Add ENC_ASCII_7BITS encoding
Change-Id: I01ec87ff4181afb5b2de487fd5f5200f8d62f17d
Reviewed-on: https://code.wireshark.org/review/1088
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 896a13587f..a365276ee1 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -557,6 +557,29 @@ WS_DLL_PUBLIC gchar *tvb_get_ts_23_038_7bits_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint bit_offset, gint no_of_chars); /** + * Given an allocator scope, a tvbuff, a bit offset, and a length in + * 7-bit characters (not octets!), with the specified offset and + * length referring to a string in the ASCII 7bits encoding: + * + * allocate a buffer using the specified scope; + * + * convert the string from the specified encoding to UTF-8, possibly + * mapping some characters or invalid octet sequences to the Unicode + * REPLACEMENT CHARACTER, and put the resulting UTF-8 string, plus a + * trailing '\0', into that buffer; + * + * and return a pointer to the buffer. + * + * Throws an exception if the tvbuff ends before the string does. + * + * If scope is set to NULL it is the user's responsibility to wmem_free() + * the memory allocated. Otherwise memory is automatically freed when the + * scope lifetime is reached. + */ +WS_DLL_PUBLIC gchar *tvb_get_ascii_7bits_string(wmem_allocator_t *scope, + tvbuff_t *tvb, const gint bit_offset, gint no_of_chars); + +/** * Given an allocator scope, a tvbuff, a byte offset, a byte length, and * a string encoding, with the specified offset and length referring to * a null-padded string in the specified encoding: |