aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-13 16:04:56 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-23 11:35:11 +0000
commit16df1e17e6e96f8dd0ba67003c6abb7083b9d7ec (patch)
tree464e915cf4b602510b59425534a9f9c179df1647 /src/mm-modem-helpers.h
parent63fa9eee462de9270e3ab44eab43050877982cf1 (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 'src/mm-modem-helpers.h')
-rw-r--r--src/mm-modem-helpers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h
index fb556543..0f314959 100644
--- a/src/mm-modem-helpers.h
+++ b/src/mm-modem-helpers.h
@@ -429,7 +429,8 @@ const gchar *mm_3gpp_facility_to_acronym (MMModem3gppFacility facility)
MMModemAccessTechnology mm_string_to_access_tech (const gchar *string);
void mm_3gpp_normalize_operator (gchar **operator,
- MMModemCharset cur_charset);
+ MMModemCharset cur_charset,
+ gpointer log_object);
gboolean mm_3gpp_parse_operator_id (const gchar *operator_id,
guint16 *mcc,