[fpc-devel] Unicode support (again)

Michael Schnell mschnell at lumino.de
Tue Nov 11 10:48:27 CET 2008


> Surely this is allowed and works correctly under D2009, otherwise I
> really misunderstood Unicode support in D2009.
>   
In D2009, "String" is WideString, and the VCL API is done with this 
(Wide)String. So this of course works. With Lazarus things are more 
complex, as they need to support a lot of environments for the LCL. Even 
small embedded environments need to be taken into account, so generally 
using WideString is not a good idea.

I feel that this is why FPC should be configurable to have "String" be 
either of ANSIString, UTF8String or WideString, and WideString to be 
configurable to be either of UTF16String or UCS2String, while of course 
all these types always do exist with their proper names and conversion 
between them is automatically done as needed.

Moreover, IMHO, it should be configurable if in "D2009 compatible mode", 
with s[i], length(s), pos(), copy, delete(), ..., Strings are counted in 
subcodes (fast behavior) or in "whatever mode" they are counted in 
characters ("friendly old school behavior"), Of course appropriate 
functions (overloaded for all types) need to exist to do the "friendly" 
and the "fast" functionality an all modes.

-Michael



More information about the fpc-devel mailing list