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

Reply via email to