David Rodriguez Salazar wrote: > Arno, > > > > It works, thank you very much....
You are welcome, but note that converting to ANSI with current code page was not neccessarily correct. The code page or accepted encoding can be retrieved from either the content-type attribute of the form, the http-equiv meta tag of the document or from the content-type header the server sent. -- Arno Garrels > > Saludos > > David Rodriguez Salazar > > > > >> From: arno.garr...@gmx.de >> To: twsocket@elists.org >> Date: Sat, 19 Dec 2009 12:07:06 +0100 >> Subject: Re: [twsocket] FW: problem with Httpcli and Tstream and >> Delphi 2009 >> >> David Rodriguez Salazar wrote: >>> >>> I always use the examples of ICS application to write my programs, >>> Is there another way to do a Post function without using tstream. >> >> The demo still contains a Unicode bug! >> >> procedure THttpTestForm.PostOrPut(Request: THttpRequest); >> var >> DataOut : TMemoryStream; >> DataIn : TFileStream; >> Buf : AnsiString; <== **Change to ANSI** >> I : Integer; >> begin >> DisplayMemo.Clear; >> DocumentMemo.Clear; >> SetButtonState(FALSE); >> >> try >> DataOut := TMemoryStream.Create; >> Buf := AnsiString(DataEdit.Text); // **Explizit cast to ANSI to >> avoid warning** >> >> >> -- >> Arno Garrels >> >>> >>> >>> Saludos >>> >>> David Rodriguez Salazar >>> >>> >>> >>> >>> >>> >>> >>>> From: arno.garr...@gmx.de >>>> To: twsocket@elists.org >>>> Date: Sat, 19 Dec 2009 09:13:59 +0100 >>>> Subject: Re: [twsocket] FW: problem with Httpcli and Tstream and >>>> Delphi 2009 >>>> >>>> Hello David >>>> >>>>> I have a problem with this component ICSHttpprotocol under delphi >>>>> 9, the problem is when I send data using post, the data is >>>>> converted in the new style of delphi 9 (char = 2 bytes), >>>> >>>> ICS does not convert posted data. It sends the content of the >>>> stream as >>>> is, byte per byte. >>>> >>>>> and the data is sent >>>>> corrupted, so the server fails. >>>> >>>> Do not send Unicode text. >>>> >>>>> The problem is when the data is copy >>>>> from Fsendstream (tstream-char) to FSendBuffer (Byte) in the >>>>> procedure SocketDataSent. Pls, Check the code. >>>>> >>>>> I also attached the capture and the data send to the server. >>>>> >>>>> In the example and send "test=2" but the data is send as "t.e.s.", >>>>> the dot means character 0. >>>> >>>> This is no bug but "as designed"! If you have to POST text it must >>>> be encoded with the correct code page. >>>> >>>> -- >>>> Arno Garrels >>>> >>>> -- >>>> 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 >>> >>> _________________________________________________________________ >>> Keep your friends updated—even when you’re not signed in. >>> http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010 >> -- >> 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 > > _________________________________________________________________ > Keep your friends updated—even when you’re not signed in. > http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010 -- 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