Graeme Geldenhuys schrieb:
On 2011-10-21 00:20, Hans-Peter Diettrich wrote:
your legacy code can assume that every (visible) character is a Char, in an SBCS codepage, this is not different in UTF-16.

Rookie mistake!!! You forgot surrogate pairs in UTF-16.

Which Ansi characters translate into surrogate pairs?


Now in UTF-8, this is not a problem at all. Finding a visible character
in the BMP or Supplementary Plane is a identical process, no special
checking is required. Thus making UTF-8 much easier and safer to use.

Please specify "Finding", a code snippet would be nice.


I've ported enough Delphi code to FPC + fpGUI where UTF-8 is used for
Unicode support. I fully agree with Felipe, using UTF-8 is much easier
with legacy code that UTF-16.

This only demonstrates that UTF-16 has not been supported sufficiently in FPC, until now. Give an example of UTF-8 code, which would become *more* complicated with UTF-16.

DoDi


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to