[fpc-devel] Unicode support (yet again)

Luiz Americo Pereira Camara luizmed at oi.com.br
Thu Sep 15 04:40:26 CEST 2011


On 14/9/2011 06:48, Graeme Geldenhuys wrote:
> On 14/09/2011 11:19, Luiz Americo Pereira Camara wrote:
>> This is not desirable simply because at each platform (windows / unix)
>> the user code of the same program will have a different encoding
>> increasing the possibility of subtle errors.
> Why? Not every program is a text manipulation program or text parser.
> Most programs simply assign one string to another.
>
> eg:
>
>     Button1.Caption := 'Click me';
>     lMyString := Button1.Caption;

Given that Button1.Caption will be different under windows and unix, 
even if the compiler provides automatically conversion, at least some 
changes will be required to the default classes that handles things like 
(de)serialization etc and the places where these methods should be used 
must be checked.

Moreover having different encodings in different platforms will give no 
gain to libraries like LCL/Lazarus like stated by DoDi.

All in all my proposition is similar to yours. The only difference is 
that by default i suggest to be used only in RTL but nothing stops to 
users like you using it in a broader scope.

The other difference is the name that i dont care (can be xString, 
MultiString, FPCString). Just i think that using UnicodeString to a 
variable encoding per platform will loose Delphi compatibility for no 
good and more: will be floods of bugreports asking why Delphi code does 
not work this way and asking for a "fix".

Luiz








More information about the fpc-devel mailing list