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

Jonas Maebe jonas at freepascal.org
Tue Sep 8 20:27:20 CEST 2020


On 07/09/2020 08:51, LacaK via fpc-pascal wrote:

> attached simple Lazarus compilable project (one Form).
> 
> ...
> type
>   String1250 = type AnsiString(1250);
> 
> const
>   c2: AnsiString = 'áéíóčž';
>   c3: WideString = 'áéíóčž';
>   c4: String1250 = 'áéíóčž';
> 
> { TForm1 }
> 
> procedure TForm1.FormShow(Sender: TObject);
> begin
>   label1.Caption:='áéíóčž'; // FAIL
>   label2.Caption:=c2;       // FAIL
>   label3.Caption:=c3;       // OK
>   label4.Caption:=c4;       // FAIL
> end;

The attached pure FPC-variant of your project works fine with FPC 3.2.0
for me (except for the very first writeln, because that one gets
interpreted as "writeln(shortstring)"), so it may be Lazarus-specific.
Best ask it on the Lazarus list or post it on their bug tracker instead.

Also make sure you did *not* build your Lazarus with -dDisableUTF8RTL


Jonas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_cp1250_1.pas
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200908/b56dc875/attachment.ksh>


More information about the fpc-pascal mailing list