Chinese characters in SMS

Q: I am able to send out SMS in English, however when I tried to send out an SMS in Chinese, what I got back on my mobile are just funny characters. I even selected “Unicode” as my data coding scheme.

A: You can assign directly in unicode to WideUD and test what happen. You can display incomming chinese messages using WideUD property (in unicode). First you must check DCS what encoding is used. Non-plaint text text is displayed as hex dump or is crippled due to non-unicode VCL (depends on Windows code page as well).


Q: I am now facing this situation...

In gm_GSM.LogSMS, your code is :

If aSMS is TSMSDeliver then
Begin
   With aSMS as TSMSDeliver do
   Begin
   S2 := Format('>%s, OA: %s, PID: %.2x, UD: %s%s',[DateTimeToStr(SCTS), OA, PID, S3, LogSafe{SMStoISO}(UD)]);
   End;
End

I checked on the SMS.Log, if the data is sent in English, it becomes :

>4/18/2005 12:05:32 PM, OA: +601230111111, PID: 00, UD: Hello World

However, if data is sent in Chinese, it becomes :

>4/18/2005 12:11:04 PM, OA: +601230111111, PID: 00, UD: 4E004E8C4E09

The UD is correct, where there are 3 Chinese characters (1 Chinese character takes up 4 characters), but how do I display it as Chinese? Can I put in as WideUD in the format?


A: You can of course process WideUD by yourself - log to db, assign to a widestring variable, a TNT control.

e.g.

var
s2: widestring;
S2 := Format('>%s, OA: %s, PID: %.2x, UD: %s',[DateTimeToStr(SCTS), OA, PID, S3])  + WideUD;
//or
S2 := WideFormat('>%s, OA: %s, PID: %.2x, UD: %s',[DateTimeToStr(SCTS), OA, PID, S3, WideUD]);