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

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Dec 17 09:23:52 CET 2013


On Mon, 16 Dec 2013 23:41:34 -0200
Marcos Douglas <md at delfire.net> wrote:

>[...]
> I think use one encoding on all platforms is good, however Windows
> uses UTF-16. All string from/to Windows needs to be converted, right?
> Is this not a penalty for Windows platform?

The Windows API is UTF-16, most text files and databases are not. You
will always have some conversions. In most cases the conversion is
hardly measurable, but there are cases where UTF-16 is better and cases
where UTF-8 is better. And in some cases even UTF-32 is better.
The LCL is graphical library, so string speed hardly matters.


> What coding FPC's team chose to use on Windows in the next release of
> the compiler, UTF-16?

I'm not member of the FPC team, but afaik UTF-16 would be a big
incompatibility, so the next release will still using system codepage
string for Windows. Maybe eventually another flavor with UTF-16.

 
>[...]
> Lazarus uses only 'string', not UTF8String, UnicodeString,
> RawByteString, etc. This will change?

Lazarus used only string (AnsiString), now it has to be more specific
at some places to avoid unnecessary conversions by the compiler.

Mattias




More information about the Lazarus mailing list