Re: [twsocket] ICS and D2009 - Chinese data in Buffer.

2009-02-26 Thread wayne forrest
Thank you guys, so simple yet so hard to see, it makes sense. On Thu, Feb 26, 2009 at 2:29 PM, Olivier Sannier wrote: > wayne forrest wrote: > > I am expecting ASCII text yet I get the Chinese > Because you use your "buffer" as an array of byte, yet you declare it as > an array of Char. > In D

Re: [twsocket] ICS and D2009 - Chinese data in Buffer.

2009-02-26 Thread Olivier Sannier
wayne forrest wrote: > I am expecting ASCII text yet I get the Chinese Because you use your "buffer" as an array of byte, yet you declare it as an array of Char. In Delphi 2009 Char is Unicode, hence the chinese characters because two bytes you received are combined to form one unicode character.

Re: [twsocket] ICS and D2009 - Chinese data in Buffer.

2009-02-26 Thread Arno Garrels
wayne forrest wrote: > Hello, I am experiencing a problem with ICS where the Receive buffer > is an array of char, In D2009 a Char is a WideChar. Receive into an array of AnsiChar or Byte instead. If the received data contains plain ASCII chars no problem, if not you need to convert to Unicode

[twsocket] ICS and D2009 - Chinese data in Buffer.

2009-02-26 Thread wayne forrest
Hello, I am experiencing a problem with ICS where the Receive buffer is an array of char, When I receive the data it is not what I expected, maybe my data sent is wrong or the receiver end. The code worked perfect with Delphi 7 but with Delphi 2009 it is failing; In my Code I have replaced all oc