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

Marcos Douglas md at delfire.net
Fri Dec 20 01:47:27 CET 2013


On Thu, Dec 19, 2013 at 9:46 PM, Juha Manninen
<juha.manninen62 at gmail.com> wrote:
> 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.

Not _only_ to UTF-16? It will depend on the OS?

>> 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.

For now (2.6.2) works ok only for AnsiString... I'm talking about
codify TStringList class to work with UTF-8 but no changes in string
type arguments.

> 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.

The same here... I think.

Marcos Douglas




More information about the Lazarus mailing list