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

Juha Manninen juha.manninen62 at gmail.com
Fri Dec 20 00:46:18 CET 2013


On Thu, Dec 19, 2013 at 11:58 PM, Marcos Douglas <md at delfire.net> wrote:
> Using UTF8String the compiler converts to UTF-16 automatically?

Yes, Delphi does that. Future FPC versions will do automatic
conversion, too, but not only to UTF-16.

> I thought that, e.g., override the RTL classes and functions:
> type
>   TStringList = class(Classes.TStringList)
>     // using UTF-8
>   end

No, with FPC you don't need to do that. The existing StringList works ok.

With Delphi you would need to copy the whole class, name it
TUtf8StringList, and replace "string" with "UTF8String".
This new class must NOT inherit from Classes.TStringList.

Juha




More information about the Lazarus mailing list