[Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

Sven Barth pascaldragon at googlemail.com
Wed May 3 22:28:53 CEST 2017


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


More information about the Lazarus mailing list