Hi Francois, Yes it works fine. Thanks!
Peter 2011.01.25. 9:27 keltezéssel, Francois PIETTE írta: > Hello Péter, > > Thanks for your help. > I have updated the source code as follow. Please check if this works > for you before I commit the change to the repository. > > function THttpConnection.HtmlPageProducerToString( > const HtmlFile : String; > UserData : TObject; > Tags : array of const) : String; > var > Stream : TMemoryStream; > const > NulByte : Byte = 0; > begin > Stream := TMemoryStream.Create; > try > HtmlPageProducerToStream(HtmlFile, UserData, Tags, Stream); > {$IFDEf COMPILER12_UP} > // For unicode char compiler (D2009 and up) > // Add a nul byte at the end of string > Stream.Write(NulByte, 1); > Result := String(PAnsiChar(Stream.Memory)); > {$ELSE} > // For ansi char compiler > SetLength(Result, Stream.Size); > Stream.Seek(0, 0); > Stream.Read(Result[1], Stream.Size); > {$ENDIF} > finally > Stream.Free; > end; > end; > > -- > francois.pie...@overbyte.be > The author of the freeware multi-tier middleware MidWare > The author of the freeware Internet Component Suite (ICS) > http://www.overbyte.be > -- 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