[fpc-devel] Unicode support (yet again)

Marcos Douglas md at delfire.net
Tue Sep 13 22:24:32 CEST 2011


On Tue, Sep 13, 2011 at 5:14 PM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> 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).

Perhaps the middle way(?)

Take what Michael said:

On Tue, Sep 13, 2011 at 4:23 PM, Michael Van Canneyt
<michael at freepascal.org> wrote:
> The ansistring version must remain for backwards compatibility.
>
> Current strategy on fpc core seems to be to have 2 RTLs:
>
> One with unicode string, one with ansistring. They will have the same code,
> but will be compiled twice, each time with a different compiler define to
> decide which version it must be.

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

...and we have 2 RTL:
1. one to AnsiString (backwards compatibility);
2. one to UnicodeString to especific plataform.

=)

Marcos Douglas



More information about the fpc-devel mailing list