• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Invalid TP-User-Data-Length for strings containing double-byte characters

Started by KL118, November 22, 2011, 02:59:35 pm

Previous topic - Next topic

KL118

Just downloaded the nrCommLib for evaluation purpose.  I am using Delphi 6 for testing and the complied program was running on Windows XP SP2.

Sending SMS is perfectly OK except for strings containing double-byte characters (in Chinese).  Followings are the extracted key codes:

nrPduSms.Coding := pc16bit;
nrPduSms.Text := '123'#164#165'123';
nrGsm.Send(nrPduSms);

The Send function has ERROR returned.

I found that the AsPDU created was:
'...0008AA100031003200334E30003200330034'

The resulting UTF-16 TP-User-Data is correct as the unicode for '#164#165' is '4E30'. However, the TP-User-Data-Length (x10) is wrong and the correct length of TP-User-Data should be equal to 14 (i.e. x0E).


Roman Novgorodov

Hello

Thank you for information.

Text property has WideString type.

I don't understand why two chars #164#165 are equal to single 16bit char '4E30'. Please explain.

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.