diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-07 17:51:15 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:15:00 +0100 |
commit | 9c5e8d697c966902cd8ac4afd208ba476ce94f53 (patch) | |
tree | bb347ec678556a46d4b884795b117abe5eb2de37 /src | |
parent | a8ca3df9be2a44465380fe68c5ea276cc51a3927 (diff) |
broadband-modem: try to get SMS text and number in the current charset
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index cfd5e06b..cdffa020 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -3878,7 +3878,7 @@ sms_text_part_list_ready (MMBroadbandModem *self, while (g_match_info_matches (match_info)) { MMSmsPart *part; guint matches, idx; - gchar *number = NULL, *timestamp, *text, *ucs2_text; + gchar *number, *timestamp, *text, *ucs2_text; gsize ucs2_len = 0; GByteArray *raw; @@ -3895,16 +3895,21 @@ sms_text_part_list_ready (MMBroadbandModem *self, /* <stat is ignored for now> */ + /* Get and parse number */ number = get_match_string_unquoted (match_info, 3); if (!number) { mm_dbg ("Failed to get message sender number"); goto next; } + number = mm_charset_take_and_convert_to_utf8 (number, + self->priv->modem_current_charset); + /* Get and parse timestamp (always expected in ASCII) */ timestamp = get_match_string_unquoted (match_info, 5); - text = g_match_info_fetch (match_info, 6); - /* FIXME: Text is going to be in the character set we've set with +CSCS */ + /* Get and parse text */ + text = mm_charset_take_and_convert_to_utf8 (g_match_info_fetch (match_info, 6), + self->priv->modem_current_charset); /* The raw SMS data can only be GSM, UCS2, or unknown (8-bit), so we * need to convert to UCS2 here. |