charsets: make translit optional in utf8_to_unpacked_gsm()

If the conversion is not fully compatible, the user of the method
needs to request transliteration enabled explicitly in order to avoid
returning errors in this method.
This commit is contained in:
Aleksander Morgado
2020-11-26 23:22:57 +01:00
parent 5ce97abd73
commit bc449cbe87
6 changed files with 41 additions and 20 deletions

View File

@@ -2305,8 +2305,11 @@ encode (MMIfaceModem3gppUssd *self,
guint8 *gsm, *packed;
guint32 len = 0, packed_len = 0;
gsm = mm_charset_utf8_to_unpacked_gsm (command, FALSE, &len, error);
if (!gsm)
return NULL;
*scheme = MM_MODEM_GSM_USSD_SCHEME_7BIT;
gsm = mm_charset_utf8_to_unpacked_gsm (command, &len);
/* If command is a multiple of 7 characters long, Huawei firmwares
* apparently want that padded. Maybe all modems?