[fpc-pascal] FPC vs Delphi's unicode string support questions

Sven Barth pascaldragon at googlemail.com
Sat Aug 18 22:22:38 CEST 2012

On 18.08.2012 17:48, Ludo Brands wrote:
>> Only in {$mode delphiunicode} (which is what you should use if you
>> want to compile code written for a Delphi version in which
>> string=unicodestring).
> Is this hidden gem announced or documented somewhere? Is there a -M<x>
> compiler switch to set it as default language mode? FPC doesn't list it yet.

I don't know whether Michael documented it already, but it's not 
announced, because there's no guarantee yet, that it will work as 

E.g. consider the following example:

{$mode delphiunicode}

   TMyStringList = class(TStringList)
     function Add(const aText: String): Integer; override;

This will currently give a compile error, because TStringList is 
compiled with "String = AnsiString" and thus the override is incorrect.

AFAIK there isn't any switch for that mode yet. You might want to create 
a bug report...


More information about the fpc-pascal mailing list