[Lazarus] UTF8String and UTF8Delete

Bart bartjunk64 at gmail.com
Sat Dec 12 19:00:07 CET 2015


On 12/12/15, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:

>>> It *can* be changed (but how?).
>> DefaultSystemCodePage := CP_UTF8;
>>
> So I need to add this to my program(s) now?
> Where?
> In each unit?
> In the main program?

If you write a program in Lazarus which uses the LCL (which in turn
uses LazUtils) then this is done for you by the LazUtils package at
initialization of the fpcadds unit.
(Mind you, it does NOT do this when you define disableUtf8RTL in
projectoptions or on commandline.)

And it needs to be done only once.

> Then why does it say:
> "Since FPC 2.7.1 the default system codepage of the RTL can be changed to UTF-8
> (CP_UTF8)"
> It should say:
> "Since FPC 2.7.1 the default system codepage of the RTL *is* UTF-8 (CP_UTF8)"

Why in the world would you think so?

Unless you actively alter DefaultSystemCodePage in code in your
program (as LazUtils does, see above), the value of this is determined
at program start and is dependant on you current system locale (cp1252
on West-European Windows, UTF8 on most Linux).

Bart




More information about the Lazarus mailing list