[fpc-devel] Delphi incompatible encoding

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Dec 1 14:56:48 CET 2014


Hans-Peter Diettrich wrote on ma, 01 dec 2014:

> program rawtest;
> var
>   s: AnsiString; //UTF8String;
>   r: RawByteString;
> begin
>   s := 'abc';
>   r := s;
>   WriteLn('s CP: ',StringCodePage(s)); //1252

I forgot to mention that the above also prints 0 in FPC if you don't  
compile in mode delphiunicode or with the systemcodepage modeswitch  
(by design).

>   WriteLn('r CP: ',StringCodePage(r)); //XE: 1252, FPC: 0
>   s := r;
>   WriteLn('s CP: ',StringCodePage(s)); //XE: 1252, FPC: 0
> end.


Jonas



More information about the fpc-devel mailing list