IF ISCLEAR(Stream) THEN CREATE(Stream); IF ISCLEAR(Stream2) THEN CREATE(Stream2); Stream.Type := 2; // Text Stream.Charset := 'utf-8'; Stream.Open; Stream.LoadFromFile(InFile); Stream2.Type := 2; Stream2.Charset := 'iso-8859-1'; Stream2.Open; Stream2.Position := 0; Stream2.SetEOS; WHILE NOT Stream.EOS DO BEGIN Line := Stream.ReadText(1); Stream2.WriteText(Line); END; OutFile := ClientTempFileName('txt'); Stream2.SaveToFile(OutFile, 2); [code] The variables [code] Name DataType Subtype Length Stream Automation 'Microsoft ActiveX Data Objects 2.5 Library'.Stream Stream2 Automation 'Microsoft ActiveX Data Objects 2.5 Library'.Stream Line Text 1024 OutFile Text 1024 [code] Function ClientTempFileName [code] ClientTempFileName(FileExtension : Text[250]) FileName : Text[1024] TempFile.CREATETEMPFILE; FileName := TempFile.NAME + '.' + FileExtension; TempFile.CLOSE; [code] The variables [code] Name DataType Subtype Length TempFile File
Answers
Regards
Hi @ftornero
Thank you soo much for the help. I was Reading BigText into Stream object that was giving me some weird results.
Now after using files, it is working as required