aboutsummaryrefslogtreecommitdiff
path: root/src/mm-charsets.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-12-21 14:20:13 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-23 11:35:11 +0000
commit033e174e445ff7606ea43191a4a5c141413e10e2 (patch)
treeb5f2cdb7cf5f1759ed6c68e5a63b878821ec6417 /src/mm-charsets.c
parent8bfdfb187b9c911366376f1574dc7e45fe4f0767 (diff)
charsets: make charset_gsm_unpacked_to_utf8() private
Use the generic mm_modem_charset_bytearray_to_utf8() instead.
Diffstat (limited to 'src/mm-charsets.c')
-rw-r--r--src/mm-charsets.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mm-charsets.c b/src/mm-charsets.c
index b0f4ea60..93e60e10 100644
--- a/src/mm-charsets.c
+++ b/src/mm-charsets.c
@@ -343,11 +343,11 @@ utf8_to_gsm_ext_char (const gchar *utf8,
return FALSE;
}
-guint8 *
-mm_charset_gsm_unpacked_to_utf8 (const guint8 *gsm,
- guint32 len,
- gboolean translit,
- GError **error)
+static guint8 *
+charset_gsm_unpacked_to_utf8 (const guint8 *gsm,
+ guint32 len,
+ gboolean translit,
+ GError **error)
{
g_autoptr(GByteArray) utf8 = NULL;
guint i;
@@ -744,7 +744,8 @@ mm_charset_take_and_convert_to_utf8 (gchar *str,
break;
case MM_MODEM_CHARSET_GSM:
- utf8 = (gchar *) mm_charset_gsm_unpacked_to_utf8 ((const guint8 *) str, strlen (str), FALSE, NULL);
+ /* This is WRONG! GSM may have embedded NULs (character @)! */
+ utf8 = (gchar *) charset_gsm_unpacked_to_utf8 ((const guint8 *) str, strlen (str), FALSE, NULL);
g_free (str);
break;
@@ -1111,10 +1112,10 @@ mm_modem_charset_bytearray_to_utf8 (GByteArray *bytearray,
switch (charset) {
case MM_MODEM_CHARSET_GSM:
- utf8 = (gchar *) mm_charset_gsm_unpacked_to_utf8 (bytearray->data,
- bytearray->len,
- translit,
- error);
+ utf8 = (gchar *) charset_gsm_unpacked_to_utf8 (bytearray->data,
+ bytearray->len,
+ translit,
+ error);
break;
case MM_MODEM_CHARSET_IRA:
case MM_MODEM_CHARSET_UTF8: