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
{$IFDEF FPC}
  {$mode objfpc}
  {$h+}
  {$CODEPAGE cp1250}
{$ENDIF}
{$H+}

{$ifdef unix}
uses
  cwstring;
{$endif}
type
  String1250 = type AnsiString(1250);

const
  c2: AnsiString = 'áéíóèž';
  c3: WideString = 'áéíóèž';
  c4: String1250 = 'áéíóèž';

var
  r: rawbytestring;
  s: ansistring;
begin
  DefaultSystemCodePage:=cp_utf8;
  writeln('áéíóèž');
  writeln(c2);
  writeln(c3);
  writeln(c4);
  r:='áéíóèž';
  writeln(r);
  r:=c2;
  writeln(r);
  r:=c3;
  writeln(r);
  r:=c4;
  writeln(r);
  s:='áéíóèž';
  writeln(s);
  s:=c2;
  writeln(s);
  s:=c3;
  writeln(s);
  s:=c4;
  writeln(s);
end.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to