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

Juha Manninen juha.manninen62 at gmail.com
Fri Dec 20 07:22:38 CET 2013


On Fri, Dec 20, 2013 at 2:47 AM, Marcos Douglas <md at delfire.net> wrote:
> Not _only_ to UTF-16? It will depend on the OS?

No, FPC string will know its encoding and the conversion is made to
any encoding but only when needed.
Let's not go deeper into this subject here. The details of future FPC
are still open and they are not yet documented.
When "Unicode" is mentioned, usually people start to argue about how
it SHOULD be done.
You can search in fpc-pascal and fpc-dev histories for that.


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

Again no. TStringList in 2.6.2 works ok for UTF-8 encoded strings, too.
The same is true for future FPC versions because they are not
hard-coded for UTF-16 (as Delphi is).


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

No no no :)

Juha




More information about the Lazarus mailing list