The code is wrong and should give you an Access Violation. It should be like this:
uStr:=TStringList.Create; try uStr.Assign(SynEdit.Lines); finally uStr.Free; end; uStr.SaveToFile(sDlg.Filename);
Didn't read any thing but your code:The code is wrong and should give you an Access Violation. It should be like this:
uStr:=TStringList.Create; try uStr.Assign(SynEdit.Lines); finally uStr.Free; end; uStr.SaveToFile(sDlg.Filename);
uStr:=TStringList.Create; try uStr.Assign(SynEdit.Lines); uStr.SaveToFile(sDlg.Filename); finally uStr.Free; end;
Just one q:Because the whole LCL is utf8-aware.
Why or can the SynEdit be setup to except UTF8 characters by default??
Besides lconvencoding there is another utf8-related unit which you should memorize: lazutf8...
Similarly, for utf16-related functions you have a good chance in unit lazutf16.
And for unicode (=utf8 or utf16) you should know that there is a lazunicode.
Difficult to remember?
uses LConvEncoding uStr:=TStringList.Create; try ustr.Assign(UTF8ToConsole(SynEdit.Lines.Text)); finally uStr.Free; end; uStr.SaveToFile(sDlg.Filename);
That is Code page 437, the old IBM page but I am not so sure your console is showing this?
So, I downloaded your ZIp file, but it is missing Form1Sorry. I work with Laz trunk which uses a different file format in some places, and I always forget to save projects in the old format. In the attachment, there is the corrected project.