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

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun May 7 11:57:31 CEST 2017


On 2017-05-07 09:10, Florian Klaempfl via Lazarus wrote:
>> Yeah, that would be the logical thing to do. 
>
> Why? What makes a string literal UTF-8?
> 

As Mattias said, the fact that the source unit is UTF-8 encoded.
Defined by a BOM marker, or -Fcutf8 or {$codepage utf8}. If the source
unit is UTF-8 encoded, the literal string constant can't (and
shouldn't) be in any other encoding.

I would say the same if the source unit was stored in UTF-16
encoding. Then string literals would be treated as UTF-16.

It's perfectly logical to me.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list