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.
This commit is contained in:
Aleksander Morgado
2021-02-23 11:35:11 +00:00
parent 5480cb67b2
commit 5ce97abd73
7 changed files with 95 additions and 64 deletions
+1 -1
View File
@@ -2343,7 +2343,7 @@ decode (MMIfaceModem3gppUssd *self,
/* if the last character in a 7-byte block is padding, then drop it */
if ((bin_len % 7 == 0) && (unpacked[unpacked_len - 1] == 0x0d))
unpacked_len--;
return (gchar*) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len);
return (gchar *) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len, FALSE, error);
}
/*****************************************************************************/