[fpc-devel] Unicode support (yet again)

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Sep 13 22:14:09 CEST 2011


On 13 September 2011 21:25, Marcos Douglas wrote:
>
> Graeme Geldenhuys, sometime, written that string type shoud be
> depended of plataform. I agree with him, but I don't know if this is

+1  ;-)


> the easiest way... but this is be best way to codify our programs,
> don't you think?

UnicodeString should meant UTF-8 on Linux, *BSD, MacOSX etc
Unicodestring should mean UTF-16 on Windows.

That way you will have the best performance on each platform, because
the string type is native to each platform.

All string function in the RTL should be unicode aware, and not make
stupid assumptions as is done so often with AnsiString (the whole 1
byte being 1 char).


PS:
I still can't believe Delphi was that stupid making the assumption
that Unicode (as in UnicodeString) = UTF-16. Especially now that they
are starting to support other platforms too, the name "unicodestring"
now doesn't always mean the native string type. :-(  FPC should make
this mistake.

-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net



More information about the fpc-devel mailing list