[Lazarus] UTF8 RTL for Windows
Mattias Gaertner
nc-gaertnma at netcologne.de
Mon Nov 24 17:10:07 CET 2014
On Mon, 24 Nov 2014 12:45:54 -0300
luiz americo pereira camara <luizmed at oi.com.br> wrote:
> 2014-11-24 8:15 GMT-03:00 Mattias Gaertner <nc-gaertnma at netcologne.de>:
>[...]
> > This works with or without {$codepage utf8}:
> >
> > S := 'João'; // constant to (Ansi or Short)string
> >
>
> Without {$codepage utf8}
> When DefaultSystemCodePage is CP_ACP the variable S will have the content
> of UTF8 but the encoding will be ACP (in my case 1252), just like is today.
> With DefaultSystemCodePage as CP_UTF8 both content and code page will match
Yes, but CP_ACP is treated as CP_UTF8. So it does not matter.
> [..]
>
> I guess it would be a good idea to pass -Fcutf8 with FPC 2.7.1. For
> > both modes.
> >
> >
> Probably yes.
> There's one case that must be tested. When the file is encoded in ansi like
> those shared with Delphi.
> What i understand with -Fcutf8, the compiler will interpret those content
> as UTF8 creating wrong encoded constant.
Yes.
> $codepage directive overrides -Fcutf8?
Yes.
> If so, to fix the developer could use $codepage with the correct file
> encoding
Yes.
Mattias
More information about the Lazarus
mailing list