diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-11-26 23:07:11 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-23 11:35:11 +0000 |
commit | 5ce97abd73da12b64393be798f2c294d29be2705 (patch) | |
tree | 48010cd5880f1dc07fd24e2156ecd7fd9290622b /src/mm-charsets.h | |
parent | 5480cb67b283c078770b02766c37768cb0930d7b (diff) |
charsets: make translit optional in gsm_unpacked_to_utf8()
Until now, this method would automatically apply transliteration;
i.e. replacing characters with '?' when no direct translation was
available.
We can attempt to do that transliteration on strings that are not
critical, e.g. the operator name reported by the network. But we
should not do that on other types of strings, e.g. on SMS contents
that may really have additional purposes than just being
human-readable.
This commit makes the transliteration option to be explicitly
requested by the caller.
Diffstat (limited to 'src/mm-charsets.h')
-rw-r--r-- | src/mm-charsets.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mm-charsets.h b/src/mm-charsets.h index a84b7ac5..dc8613a5 100644 --- a/src/mm-charsets.h +++ b/src/mm-charsets.h @@ -53,10 +53,12 @@ gchar *mm_modem_charset_byte_array_to_utf8 (GByteArray *array, gchar *mm_modem_charset_hex_to_utf8 (const gchar *src, MMModemCharset charset); -guint8 *mm_charset_utf8_to_unpacked_gsm (const gchar *utf8, - guint32 *out_len); -guint8 *mm_charset_gsm_unpacked_to_utf8 (const guint8 *gsm, - guint32 len); +guint8 *mm_charset_utf8_to_unpacked_gsm (const gchar *utf8, + guint32 *out_len); +guint8 *mm_charset_gsm_unpacked_to_utf8 (const guint8 *gsm, + guint32 len, + gboolean translit, + GError **error); /* Checks whether conversion to the given charset may be done without errors */ gboolean mm_charset_can_convert_to (const gchar *utf8, |