sql server - How Read Text File Which Was Converted From .SQL File? -
i using delphi 2005.
i have copied sp.sql file (which output file of sql server i.e. exported stored procedure 1 single .sql file) sp.txt file in delphi using below statement:
stempfilename := opendialog1.filename;// file name .sql extension stempfilename := stringreplace(stempfilename, '.sql', '.txt',[rfreplaceall, rfignorecase]); copyfile(pchar(opendialog1.filename), pchar(stempfilename), false);
the file converted .txt format, when read reads 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 read in plain text format. tried using utf8encode(stext)
function (not sure right function use) same result.
am missing anything?
this has nothing delphi. default sql server management studio saves .sql files in unicode format. can instruct application save different encoding.
in sql server 2012, under file
, advanced save options
:
choose whatever (non-unicode) encoding like. reason delphi 2005 can't read file doesn't support unicode nativly.
Comments
Post a Comment