From bc449cbe87ccebccbe35f926e88a2dd110832ddf Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 26 Nov 2020 23:22:57 +0100 Subject: 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. --- plugins/huawei/mm-broadband-modem-huawei.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index a20c0eda..dc8f758d 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -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? -- cgit v1.2.3-70-g09d2