[Lazarus] Problem encode UTF8 with BOM in unit

José Mejuto joshyfun at gmail.com
Wed Jan 25 17:33:24 CET 2012


Hello Lazarus-List,

Wednesday, January 25, 2012, 11:13:16 AM, you wrote:

H> Although BOM is valid in UTF8, its use is not recommended
H> (http://en.wikipedia.org/wiki/Byte_order_mark#cite_note-1). I'm
H> surprised Lazarus supports this at all. IMO this feature should be
H> removed and UTF-8 files with BOM should be rejected by FPC and Lazarus
H> as invalid.

Please, re-read the cite. It should be used in undetermined encoding
protocol media, like files, in fact it is quite mandatory in many of
them. The cite is about setting a BOM in things like string variables
where the protocol is expected (programatically) or database fields
where the field definition already states the encoding used.

A pascal program file without BOM is ansi as you can say that a file
could not be UTF8 but you can not say that it is not ansi unless BOM
is present.

-- 
Best regards,
 José





More information about the Lazarus mailing list