[fpc-devel] Delphi incompatible encoding

Tomas Hajny XHajT03 at hajny.biz
Tue Dec 2 09:18:29 CET 2014


On Tue, December 2, 2014 08:31, Hans-Peter Diettrich wrote:
> Jonas Maebe schrieb:
>
>> To get behaviour that is compatible with Delphi2009+, compile with
>> -Mdelphiunicode or {$modeswitch delphiunicode}.
>
> Do you mean {$mode delphiunicode}?
>
> Now I wonder about compilation at all.
> When I compile a console program on the commandline, most strings are
> readable in the console (see previous answer). But when I compile using
> Lazarus, all strings (including UnicodeString!) are shown in unreadable
> UTF-8 encoding, regardless of $mode :-(
>
> What causes this difference, and how to make strings readable in a
> (Lazarus compiled) console application?
>
> Forgot to mention: everything on WinXP.

Probably best to ask about the wrong behaviour with Lazarus on a Lazarus
list? Otherwise: In what format (encoding) is your source file? Unless
it's a UTF-8 with BOM, FPC decodes it according to the -Fc parameter and
Lazarus may pass a different setting of this option. In addition, it might
be related to Lazarus playing with Default*SystemCodePage which may not
work well with console using a different encoding, but that is just a wild
guess which would need to be checked by someone really knowing what
Lazarus does there...

Tomas





More information about the fpc-devel mailing list