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 with the correct code page. -- Arno Garrels > 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 occurrences of String with AnsiString, > but this has not solved my problem. > > > > var > Buffer : array [0..1023] of char; //reception buffer of 1024 > characters > > begin > Len := WSocket.ReceiveFrom(@Buffer, SizeOf(Buffer), Src, SrcLen); > Memo1.Lines.Add(' Data Received > from'+StrPas(inet_ntoa(Src.sin_addr))+ ':'+ > IntToStr(ntohs(Src.sin_port))+'>>'+StrPas(Buffer)); > > The Buffer Contains this: Data Received from x.y.z:6109>>汣敩瑮举䵁E > > I am expecting ASCII text yet I get the Chinese > > Any help please. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be