diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-13 16:04:56 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-23 11:35:11 +0000 |
commit | 16df1e17e6e96f8dd0ba67003c6abb7083b9d7ec (patch) | |
tree | 464e915cf4b602510b59425534a9f9c179df1647 /plugins | |
parent | 63fa9eee462de9270e3ab44eab43050877982cf1 (diff) |
helpers: rework normalize_operator() to use str_to_utf8()
Instead of blindly assuming that we can take whatever string given as
valid UTF-8, we'll always attempt to convert from the current modem
charset into UTF-8. Before we were doing this for hex-encoded UCS2,
but not for example for GSM-7.
And due to the now applied GSM-7 conversion, the mf627a/mf627b +COPS
parsing unit tests are updated accordingly, because when converting
from an input string that contains byte 0x40 ('@' in UTF-8) as if it
were GSM-7, the 0x40 is taken as character 'ยก', encoded as 0xc2,0xa1
in UTF-8).
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/altair/mm-broadband-modem-altair-lte.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/altair/mm-broadband-modem-altair-lte.c b/plugins/altair/mm-broadband-modem-altair-lte.c index d26335f7..6aebbd93 100644 --- a/plugins/altair/mm-broadband-modem-altair-lte.c +++ b/plugins/altair/mm-broadband-modem-altair-lte.c @@ -1067,7 +1067,7 @@ modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self, error)) return NULL; - mm_3gpp_normalize_operator (&operator_name, MM_MODEM_CHARSET_UNKNOWN); + mm_3gpp_normalize_operator (&operator_name, MM_MODEM_CHARSET_UNKNOWN, self); return operator_name; } |