[fpc-devel] utf-8 package in Free Pascal

Michael Schnell mschnell at lumino.de
Tue Oct 4 13:33:03 CEST 2011


On 10/04/2011 01:02 PM, Hans-Peter Diettrich wrote:
>
>
>> I wonder when Lazarus will be able to follow and use this string type 
>> for the complete library.
>
> The LCL will use one unique encoding, most probably UTF-8 as the only 
> losless Unicode representation. This means that strings with different 
> encoding are converted whenever passed to a control, or read from it.
>
This might be true and it is obviously the way to go when running on Linux.

But with dynamically encoded Strings, the LCL does not need to force a 
certain encoding on it's user code interface. It _could_ internally use 
UTF-8 on Linux and UTF-16 on Windows with the same source code (only 
some differences in the direct system API related code that is 
OS-specific anyway). In the user code auto-conversion is supposed to 
happen whenever necessary.

I suppose this would result in faster programs on Windows.

Of course auto-conversion in the user code might slow down certain 
programs hen the user somehow forces a certain coding. And inappropriate 
user code might implicitly rely on a certain internal coding of a string 
and work only on a certain OS.

-Michael



More information about the fpc-devel mailing list