aboutsummaryrefslogtreecommitdiff
path: root/src/mm-sms-part.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-06 13:04:42 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-06 13:14:16 +0200
commit32c41f62e51ece885190910e258b35f1c4f36ee4 (patch)
tree0f08d69a1c1435984526f47336c9c801ffda85ff /src/mm-sms-part.c
parent176498239f9024c5954edb06c20da0fc457cc1b6 (diff)
sms-part: add helper debug logs
Diffstat (limited to 'src/mm-sms-part.c')
-rw-r--r--src/mm-sms-part.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c
index 5fd46ff2..954d45bd 100644
--- a/src/mm-sms-part.c
+++ b/src/mm-sms-part.c
@@ -248,12 +248,16 @@ sms_decode_text (const guint8 *text, int len, SmsEncoding encoding, int bit_offs
guint32 unpacked_len;
if (encoding == MM_SMS_ENCODING_GSM7) {
+ mm_dbg ("Converting SMS part text from GSM7 to UTF8...");
unpacked = gsm_unpack ((const guint8 *) text, len, bit_offset, &unpacked_len);
utf8 = (char *) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len);
+ mm_dbg (" Got UTF-8 text: '%s'", utf8);
g_free (unpacked);
- } else if (encoding == MM_SMS_ENCODING_UCS2)
+ } else if (encoding == MM_SMS_ENCODING_UCS2) {
+ mm_dbg ("Converting SMS part text from UCS-2BE to UTF8...");
utf8 = g_convert ((char *) text, len, "UTF8", "UCS-2BE", NULL, NULL, NULL);
- else {
+ mm_dbg (" Got UTF-8 text: '%s'", utf8);
+ } else {
g_warn_if_reached ();
utf8 = g_strdup ("");
}
@@ -575,6 +579,7 @@ mm_sms_part_new_from_binary_pdu (guint index,
/* 8-bit encoding is usually binary data, and we have no idea what
* actual encoding the data is in so we can't convert it.
*/
+ mm_dbg ("Skipping SMS part text: 8-bit or Unknown encoding");
mm_sms_part_set_text (sms_part, "");
} else {
/* Otherwise if it's 7-bit or UCS2 we can decode it */