[Lazarus] Does Lazarus support a complete Unicode Component Library?
Vladimir Zhirov
vvzh.lists at gmail.com
Sat Jan 1 21:14:32 CET 2011
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.
More information about the Lazarus
mailing list