[Lazarus] Does Lazarus support a complete Unicode Component Library?
Sven Barth
pascaldragon at googlemail.com
Sun Jan 2 12:49:08 CET 2011
On 01.01.2011 21:14, Vladimir Zhirov wrote:
> Sven Barth wrote:
>
>> You need to convert the UTF8 string to a different one, e.g.
>> UTF16:
>>
>> var
>> us: UnicodeString;
>> begin
>> us := UTF8Encode(s);
>> end;
>>
>> Now us[2] will return the a-umlaut.
>
> I would suggest using Utf8Copy(s, 2, 1) instead. It helps
> to avoid conversion and works correctly even for characters
> that take 4 bytes in UnicodeString/WideString (i.e. 2
> wide characters). Utf8Copy is declared in LCLProc unit.
When using the LCL this is indeed a better way.
Regards,
Sven
More information about the Lazarus
mailing list