diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-08-07 00:23:41 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-08-21 16:50:15 +0000 |
commit | eda46d05cf9ed1a8f9aac460a55509b510b02c0b (patch) | |
tree | 6817619ecc3c1da22d3657c28f171981a4435649 /src/mm-charsets.h | |
parent | e90ced5e0f5691113abb20fb5a22e312a2bc9b68 (diff) |
charsets: new helper to convert binary input data to UTF-8
Most of all the other APIs we have are expecting binary data (e.g.
UCS-2 encoded strings) in ASCII hex format, because they were going
to be used in text AT commands. For binary protocols allowing binary
data, we need use a more generic API that provides an explicit data
size.
Diffstat (limited to 'src/mm-charsets.h')
-rw-r--r-- | src/mm-charsets.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-charsets.h b/src/mm-charsets.h index 340ae95b..2e3e6f38 100644 --- a/src/mm-charsets.h +++ b/src/mm-charsets.h @@ -43,6 +43,11 @@ gboolean mm_modem_charset_byte_array_append (GByteArray *array, gboolean quoted, MMModemCharset charset); +/* Take a string encoded in the given charset in binary form, and + * convert it to UTF-8. */ +gchar *mm_modem_charset_byte_array_to_utf8 (GByteArray *array, + MMModemCharset charset); + /* Take a string in hex representation ("00430052" or "A4BE11" for example) * and convert it from the given character set to UTF-8. */ |