[fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

Werner Pamler werner.pamler at freenet.de
Fri Jan 3 00:35:10 CET 2020


Am 02.01.2020 um 20:10 schrieb Ondrej Pokorny:
> TStrings.SaveTo*() writes BOM by default. Formerly the BOM was not 
> written.

There is also the problem that currently it is not possible, without 
further action, to retain the BOM state of a file loaded into a 
stringlist, modified and written back because the presence of a BOM is 
forgotten after reading - see the other discussion 
(https://lists.freepascal.org/pipermail/fpc-devel/2020-January/042363.html). 
Wouldn't it make sense to introduce a )Read)BOM property (a boolean 
parameter or an element of the new Options) which gets its value when 
the file is loaded or the strings are assigned? Then the user can set 
the StringList.WriteBOM equal to the StringList.BOM when he wants to 
keep the BOM for writing back.



More information about the fpc-devel mailing list