[fpc-devel] UnicodeChar and Locale variables don't work
Florian Klaempfl
florian at freepascal.org
Thu Nov 20 16:21:43 CET 2008
Graeme Geldenhuys schrieb:
> Hi
>
> How am I supposed to handle unicode characters for locale variables?
> All locale variables like ThousandSeparator is type Char and there is
> no overloaded UnicodeChar versions. This causes problems in Russian
> locales as the example below shows.
>
>
> c := UnicodeChar($00A0); // non-breaking space character
> ThousandSeparator := c;
>
> s := Format('%10.2n', [123456789.123456]);
> writeln('Russian style No-break Space char s = ', s);
>
> writeln('SizeOf(UnicodeChar) = ', SizeOf(c));
> writeln('SizeOf(ThousandSeparator) = ', SizeOf(ThousandSeparator));
>
>
> And the output is as follows:
>
> Russian style No-break Space char s = 123�456�789.12
> SizeOf(UnicodeChar) = 2
> SizeOf(ThousandSeparator) = 1
>
>
> The ThousandSeparater variable is not big enough to store the
> character. Plus, what's going to happen with > BMP characters?
Well, this is one of the thousands of little problems which need to be
solved ...
More information about the fpc-devel
mailing list