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

Vladimir Zhirov vvzh.lists at gmail.com
Sun Jan 2 21:34:30 CET 2011


cobines wrote:
> Those only work for characters in current Ansi code page.

Yes, on Win32. They also work properly for utf-8 characters
on Linux and Mac OS X.

> It is better to use UTF8Decode, UTF8Encode.

UTF8Decode and UTF8Encode do not provide any platform abstraction,
they merely convert single-byte utf-8 string to double-byte 
utf-16/usc-2 string. 

And since RTL/FCL functions on Win32 use single-byte Ansi strings, 
they cannot handle characters outside of current code page anyway.
I do not see how UTF8Decode/UTF8Encode can help here.
The only way is to use them in combination with wide version
of Windows API (functions ending with "W"), but it is not portable.

To make it clear, when I called Utf8ToSys/SysToUtf8 "general purpose"
I did not mean they should be used all over the code. They are only
needed when calling RTL/FCL functions if there is no appropriate
wrapper function like FileExistsUtf8.




More information about the Lazarus mailing list