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

Marcos Douglas md at delfire.net
Wed Dec 18 00:41:09 CET 2013


On Tue, Dec 17, 2013 at 6:23 AM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> 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.

Yes, will always have conversions... the problem are conversions
inside a only program (LCL <> RTL).  ;-)

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

So, nothing will change for Lazarus users after the new FPC release.

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

Ok, thank you for all explanations.

Marcos Douglas




More information about the Lazarus mailing list