AdvStringGrid SaveToCSV skip preamble

I load an AdvStringGrid with LoadFromCSV - the files I load might have been edited by a variety of text editors before I get them (some which add preambles to the files).

Is there some way to get the asg SaveToCSV to NOT write the preamble bytes to file when the LoadFromCSV file had the preamble bytes?

Something like the WriteBOM:=false; for TStrings?

TIA

EdB

There are several overloads rfor SaveToCSV, two of which have the TEncoding parameter that controls how the output file is encoded:

image

TEncoding.ANSI or TEncoding.UTF8 should not use a BOM

I actually tried setting the TEncoding before I posted here.

Nothing I did eliminated the preamble bytes in the text file.

After you replied, I went and did a complete and total "shut up and reboot" on my machine. I even unplugged it and went for a coffee.

Upon reboot and re-build of project: it works perfectly - preamble all gone.

There's gotta be a way to blame this on Microsoft...

Thanks Bruno.