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

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Aug 18 23:50:57 CEST 2012


On 18 Aug 2012, at 21:29, Graeme Geldenhuys wrote:

> On 18 August 2012 16:11, Jonas Maebe <jonas.maebe at elis.ugent.be> 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).
> 
> I've enabled that new compiler mode... Any idea what the following
> warning means?
> 
> -----------------
> /home/graemeg/devel/tiOPF3/src/Core/tiDefines.inc(42,4) Warning:
> Current system codepage "0" is not available for the compiler.
> Switching default codepage back to "28591".
> -----------------

Delphi unicode versions parse all string constants in source code according to the current system code page (so if you compile a source file on two different systems without explicitly specifying the source code page, you can get different results if the source code contains non-ASCII strings).

We don't have support yet for determining the current system code page on Unix platforms without linking to libc, and the compiler cannot depend on libc. The warning you see above is the consequence of that.

If you don't want this code page behaviour anyway, you can use the following

{$mode delphiunicode}
{$modeswitch systemcodepage-}


Jonas


More information about the fpc-pascal mailing list