[Lazarus] Does Lazarus support a complete Unicode Component Library?

Sven Barth pascaldragon at googlemail.com
Sun Jan 2 20:33:53 CET 2011


On 02.01.2011 18:29, Graeme Geldenhuys wrote:
> On 2 January 2011 13:47, Sven Barth<pascaldragon at googlemail.com>  wrote:
>> Casting from AnsiString to UnicodeString invokes the WideString Manager's
>> Ansi2UnicodeMoveProc which converts the supplied AnsiString to a correct
>> UTF16 string.
>
> Does that mean FPC and LCL always treats UnicodeString type as a UTF16
> encoded type? If so, that is a rather odd "type name" then, because
> "unicode" is NOT just UTF16, it is also UTF8, UTF16, UTF16-LE,
> UTF16-BE and UTF32. A better, and more correct, type name would then
> have been UTF16String, just like there is a UTF8String type (though I
> don't really know how the latter differs from AnsiString (which is
> basically an array of bytes).

Yes, UnicodeString (and WideString as well) is treated as UTF16 encoded 
string.

The type name might come from Delphi compatibility (tada!).

And currently UTF8String is defined as AnsiString, so there is currently 
no difference (which could change once the cpstrnew branch is mature 
enough).

Regards,
Sven




More information about the Lazarus mailing list