[fpc-devel] Russian locale information not compatible with FPC locale variables

Daniël Mantione daniel.mantione at freepascal.org
Tue Jul 29 10:16:48 CEST 2008



Op Tue, 29 Jul 2008, schreef Graeme Geldenhuys:

> Hi,
>
> A Russian user raised the issue in the fpGUI newsgroups...  fpGUI uses
> UTF-8 as the internal string encoding. He noticed that the File Dialog
> which displays the file sizes with thousand separators were totally
> blank.  On further investigation he noticed that it was FormatFloat()
> that caused the issue. FormatFloat uses the ThousandSeparator locale
> variable.
>
> In FPC the ThousandSeparator is of type Char which can only hold one
> byte. Yet the Russian locale uses the non-breaking space character as
> expressed in UTF-8 as 'C2 A0' (bytes) and takes up 2 bytes.  So how do
> we assign the Russian ThousandSeparator (U+00A0) in FPC to the
> ThousandSeparator variable?

As a workaround, it can be converted into a normal breaking space. There 
is no proper solution, MBCS requires it to be a string rather than a char, 
but compatibility requires it to be a char. Which means you are limited to 
SBCS compatible thousand separators.

Daniël


More information about the fpc-devel mailing list