[fpc-pascal] String literals and code page of .pas source file

Tomas Hajny XHajT03 at hajny.biz
Wed Sep 9 17:25:09 CEST 2020


On 2020-09-09 13:51, LacaK via fpc-pascal wrote:
>> 
>> > This is a bit counter intuitive to me.
>> 
>> It is explained here:
>> https://wiki.freepascal.org/Unicode_Support_in_Lazarus
>> 
> IMO "c4" case (c4: String1250 = 'áéíóčž';) is not fully explained.
> Probably what here happens is, that declared code page of c4 = source
> file code page and in that case compiler does not insert conversion
> code. StringCodePage(c4)=1250 (also StringCodePage(c2)=1250) so
> dynamic code page is right, but when assigning to TLabel.Caption
> current dynamic code page is not taken into account

A simple question - is TLabel.Caption declared as Utf8String (I don't 
use Lazarus)? _Then_ it should work without any issues and/or special 
attention from users.

Tomas


More information about the fpc-pascal mailing list