Hi Chris,
This patch is to fix reading Chinese SMS. Please help to review and
commit the patch to openmoko-dialer2 application. Also, thanks a lot for
OLV, he gave me this hint! :P
Best Regards,
Erin
Index: openmoko-dialer2/src/phone-kit/moko-sms.c
===================================================================
--- openmoko-dialer2/src/phone-kit/moko-sms.c (revision 4137)
+++ openmoko-dialer2/src/phone-kit/moko-sms.c (working copy)
@@ -299,6 +299,13 @@
break;
case ALPHABET_UCS2 :
g_debug ("Decoding UCS-2 message");
+ {
+ int i;
+ gunichar2 *ucs2 = sms->payload.data;
+
+ for (i = 0; i < sms->payload.length / 2; i++)
+ ucs2[i] = GUINT16_FROM_BE(ucs2[i]);
+ }
message = g_utf16_to_utf8 ((const gunichar2 *)sms->payload.data,
sms->payload.length, NULL, NULL, NULL);
break;