Article

From:
To:
All
Subject:
Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Newsgroup:
embarcadero.public.delphi.internet.winsock

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]

Hello,

I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I
am getting back:

2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9__rPb___'#0#0#0'__'#0#0#0#$C#0#0#0'_default.rtfE__1'#$F'__ '#$14'___w'#$13'__'#3'__'#$13'________________K__k'#$81'J __'#$D'`'#$1D#8'__]______\______\___'#$90'__'#0'__h'#$F#$19'__I4]'#3'J'#$1B'__w__H_____m_____,___________`__z______2_________'#9'6__?__________'#$1E#5'__'#$18'__1_____g__'#$AD'9g______f'#$17#$13'_____________'#$9D'____'#$F'kR'#$7F'X__~__'#5'PK'#3#4#$14#0#0#0#8#0'xTQ9__2__'#$1F'#'#$B#0#0'__1'#0#0#$14#0#0#0'SOAP Note_Croson.rtf__Z{o__8'#$12'_________'#3#$81'__q______'#$11'____c__X'...
2009: 'PK'#3#4#$14#0#0#0#8#0'rLQ9?rPb?'#0#0#0'?'#0#0#0#$C#0#0#0'_default.rtfE?1'#$F'__ '#$14'?w'#$13'__'#3'__'#$13'____?__?____K__k'#$81'J __'#$D'`'#$1D#8'__]______\______\?'#$90'?'#0'__h'#$F#$19'__I4]'#3'J'#$1B'__w__H?__m?__,?________`__z______2____?__'#9'6__?__??__'#$1E#5'__'#$18'__1?__g__'#$AD'9g______f'#$17#$13'?__________'#$9D'____'#$F'kR'#$7F'X__~__'#5'PK'#3#4#$14#0#0#0#8#0'xTQ9__2__'#$1F'#'#$B#0#0'__1'#0#0#$14#0#0#0'SOAP Note_Croson.rtf__Z{o__8'#$12'____?__'#3#$81'__q______'#$11'____c__X'...
Notice that they are not the same... The 2007 version seems to have many characters the 2009 version can't display (I assume that is why it shows ?) which lead me to think of all the new Unicode stuff in 2009.

var
	sHttpResult : Ansistring;
	slPostData : TStringList;
begin
        IdSSL.CheckForDisconnect(False);
        IDHttp.CheckForGracefulDisconnect(False);
        IdSSL.ReadTimeout := 30000;
        {Guessing on the encoding here}
        IDHttp.IOHandler.DefStringEncoding := TIdTextEncoding.ASCII;
        IDSSl.DefStringEncoding := TIdTextEncoding.ASCII;
        application.ProcessMessages;
	slPostData:= TStringList.Create;
       {Fill in the TStringlist with the post data here}
       blah blah blah
{Call to CGI/ISAPI works here, but results are different between the two versions}
       sHttpResult := IdHttp.Post(aHttpRequestData.sURL, slPostData);

Also, here is the relevant code in the ISAPI (compiled in Delphi 2007) that is being called:
       {Create File Stream to send to client}
       FileStream := TFileStream.Create(sFilename,fmShareDenyNone);
       Response.ContentStream := FileStream;
       Response.SendResponse;


Any ideas on how I could resolve this? *Thank you in advanced!*
I also posted this in the Atozed forum... I apologize if cross-posting like that is frowned upon.
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 15 Nov 2024 07:49:05 UTC
Copyright © 2009-2024
HREF Tools Corp.