[fpc-devel] Default strings encoding

peter green plugwash at P10Link.net
Tue Oct 10 22:58:45 CEST 2006


> If I have a ansistring, and cast that to a WideString, fpc is
> converting from which encoding to which encoding?
the default is ISO-8859-1 to UCS-2/UTF-16 (the only difference between the
two being UTF-16 support for surrogates), however this can be changed by
registering a widestring manager.

personally if you wan't good internationalisation support i would advise
avoiding the implicit conversion between ansistrings and widestrings and
thinking through exactly what conversion you wan't in a particular
situation, after all as you say an ansistring can hold anything.

for example if writing a html interperter you would base your conversion on
the charset part of the content type.

Would the devs consider adding a compile option to disable implicit
conversions between ansistrings and widestrings (as i belive in applications
working with multiple encodings accidental use of them could be a major
source of bigs)?




More information about the fpc-devel mailing list