[fpc-devel] TStrings and BOM

Bart bartjunk64 at gmail.com
Wed Jan 1 23:20:51 CET 2020


On Wed, Jan 1, 2020 at 9:56 PM Ondrej Pokorny <lazarus at kluug.net> wrote:

> You replace the WriteBOM property with the AWriteBOM parameter. What's the point of it? What do you plan to do with the WriteBOM property then?

I quote myself (from my fiirst post):

> SaveToStream(Fn, TEncoding.UTF8, False) is a one line change.
> Whereas:
> WriteBom := False;
> SaveToStream(Fn, TEncoding.UTF8) is a two line change.

It's just for convenience.
No, it is not a necessity.

Since the option to write the BOM or not is only used at write-time,
IMHO it would have made more sense to not introduce the WriteBom
property, but to have it as an optional parameter for the SaveTo*
methods.

I won't loose any sleep over it if it wont make it into fpc.
For the record: I did ask before trying...

-- 
Bart


More information about the fpc-devel mailing list