I am using Delphi 2005.
I have copied a SP.SQL file (which is a output file of SQL Server i.e. exported all stored procedure into one single .sql file) to SP.TXT file in Delphi using below statement:
sTempFileName := OpenDialog1.FileName;// file name with .sql as an extension
sTempFileName := StringReplace(sTempFileName, '.sql', '.txt',[rfReplaceAll, rfIgnoreCase]);
CopyFile(PChar(OpenDialog1.FileName), PChar(sTempFileName), False);
The file is converted to .txt format, but when I read it reads with below format
'ÿþS'#0'E'#0'T'#0' '#0'Q'#0'U'#0'O'#0'T'#0'E'#0'D'#0'_'#0'I'#0'D'#0'E'#0'N'#0'T'#0'I'#0'F'#0'I'#0'E'#0'R'#0' '#0'O'#0'F'#0'F'#0' '#0#0
I would like to read in plain text format. I tried using UTF8Encode(sText)
function (not sure this is the right function to use) but same result.
Am I missing anything?