[fpc-devel] ThousandSeparator and UTF-8

petr.kristan at epos.cz petr.kristan at epos.cz
Fri Oct 2 17:45:26 CEST 2009


On Fri, Oct 02, 2009 at 04:42:51PM +0200, Graeme Geldenhuys wrote:
> 2009/10/2  <petr.kristan at epos.cz>:
> > On Linux and cs_CZ.UTF-8 locale is thousand separator set to
> > NO-BREAK SPACE (UTF-8: 0xC2 0xA0).
> >
> > But ThousandSeparator variable is defined as Char. Fpc sets
> > ThousandSeparator=0xA0 and kylix ThousandSeparator=0xC2.
> >
> > Any ideas how to correctly solve it?
> 
> 
> This is a know problem reported by me some months ago. Unfortunately
> there is no fix in FPC until it full supports unicode with a char > 1
> byte.
Why not use IFDEF-ed definition *Separators as strings for backward compatibility.

{$IFDEF SEPARATORS_AS_STRINGS}
  ThousandSeparator: string;
  ...
{$ELSE}
  ThousandSeparator: Char;
{$ENDIF}

Perhaps somebody do not want to use Char=WideChar in whole project.
Maybe I.

> In the mean time, you will have to define your own locale constants
> with correct type sizes and manually do formatting. A pain in the
> butt, I know.
For me I solve it by hack replacing 0xC2 or 0xA0 to normal space 0x20.

Petr

-- 
Ing. Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223    Czech Republic (Eastern Europe) 
fax: +420 466510709



More information about the fpc-devel mailing list