On 03.05.2017 21:47, Juha Manninen via Lazarus wrote: > Why Delphi adds the BOM? Why can't it just read the file and > understand it is UTF-8?
Probably for the same reason as FPC: the default code page if no BOM is available and no command line option is set and no $codepage directive is found is ISO-8859-1. A BOM does the same as the command line option -FcUTF8 or the directive {$codepage utf8}, namely switching the source codepage to UTF-8. Only then string constants that contain UTF-8 characters are converted to UnicodeString constants. Regards, Sven -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus