Re: [Lazarus] StringGrid1.SaveToCSVFile - UTF-8 with BOM

2018-03-10 Thread Sandro Cumerlato via Lazarus
Thank you Mattias and Michael for your help! procedure TForm1.ButtonSaveClick(Sender: TObject); const UTF8BOM = #$EF#$BB#$BF; var s: String; fs: TFileStream; begin s := ChangeFileExt(Application.ExeName, '.csv'); try fs := TFileStream.Create(s, fmCreate); fs.Write(UTF8BOM, SizeOf

Re: [Lazarus] StringGrid1.SaveToCSVFile - UTF-8 with BOM

2018-03-10 Thread Michael Van Canneyt via Lazarus
On Sat, 10 Mar 2018, Mattias Gaertner via Lazarus wrote: On Sat, 10 Mar 2018 16:57:08 +0100 Sandro Cumerlato via Lazarus wrote: Hello, how can I save StringGrid content to a CSV file encoded to "UTF-8 with BOM" format? (as default it is saved to "UTF-8 without BOM" format) var s: string;

Re: [Lazarus] StringGrid1.SaveToCSVFile - UTF-8 with BOM

2018-03-10 Thread Mattias Gaertner via Lazarus
On Sat, 10 Mar 2018 16:57:08 +0100 Sandro Cumerlato via Lazarus wrote: > Hello, > how can I save StringGrid content to a CSV file encoded to "UTF-8 with BOM" > format? (as default it is saved to "UTF-8 without BOM" format) var s: string; ms: TMemoryStream ms:=TMemoryStream.Create; try s: