[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?

Marcos Douglas md at delfire.net
Wed Dec 25 12:57:05 CET 2013


On Tue, Dec 24, 2013 at 7:08 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> Am 24.12.2013 15:34 schrieb "Marcos Douglas" <md at delfire.net>:
>
>
>> Sorry if I say something crazy, but what do you think to use UTF-16 on
>> {mode delphi} and UTF-8 in {mode fpc}?
>
> That is already the case with mode delphiunicode. But the big problem are
> classes and their inheritance. Take TStringList for example. Let's assume
> it's declared with String=AnsiString and you override it in a unit with
> String=UnicodeString then you'll get problems with overloads/overrides,
> because UnicodeString <> AnsiString.

Hmm, you're right. Understood.

>
> The mode concept is all good and well, but here it breaks down... :(

So, if the {mode} continue to be a way, I think it should be used on
"platform level", not per "unit level".
Even if the programmer can to change this, he will change in all code.
Thinking better, this is to be used on compiler level, not source
level.

Regards,
Marcos Douglas




More information about the Lazarus mailing list