[fpc-devel] FPC 2.3.1 seems a mixed mess with Unicode support
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Sep 16 16:42:46 CEST 2009
On 16 Sep 2009, at 16:34, Michael Schnell wrote:
> Does the FPC rtl compare two unicode-strings a and b as equal with
> "if a=b ..."
> even when both print as "รค" and one is coded as a single character and
> the other is coded as an a and a " double dot superscript" ?
No, it just compares the literal bytes (and it will probably keep
doing so forever, both for Delphi and for backwards compatibility).
> How should it do that ? it would need a table of the codings of all
> possible multi-unicode-character encodings ?
The way to implement stuff like that is to call the appropriate
library functions. It makes no sense to completely re-implement
everything in the RTL.
Such API-calls can of course be wrapped by the RTL, similar to the way
there are already function such as sysutils.ansicomparestr()/
sysutils.ansicomparetext()/... etc. These also simply call through to
OS-supplied functionality.
Jonas
More information about the fpc-devel
mailing list