[Lazarus] Unicode on Windows

Sven Barth pascaldragon at googlemail.com
Tue Apr 10 09:57:47 CEST 2012


Am 10.04.2012 01:17, schrieb Hans-Peter Diettrich:
> Now every user has the choice to stay with a specific FPC/Lazarus
> version, that does not yet support the new string types, or to drop
> UTF-8 strings in favor of the new UTF-16 strings. Since most code has to
> deal with the Unicode BMP (BasicMappingPage) only, the difference
> between the length of an string in (UTF-8)chars and characters has gone
> away with UTF-16. Do you really see a need for finding the position of a
> non-BMP character in an string, and changing exactly that character in
> the string? Then you are on the safe side by using StringReplace, which
> already worked with UTF-8 and will continue to work with UTF-16 and
> whatever other encoding. The use of Char variables has been dangerous
> already with UTF-8, where exotic ("astral") characters can consist of up
> to 6 bytes. In so far I don't understand why Delphi now uses WideChar
> for Char, instead of UnicodeChar, where it is guaranteed that every
> codepoint (except ligatures and similar text-processing stuff) can be
> stored in a UnicodeChar variable.

You do know that WideChar and UnicodeChar are the same? Namely two byte 
characters.

Regards,
Sven




More information about the Lazarus mailing list