Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-10

ThousandSeparator and UTF-8

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

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?

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

Reply by email

Graeme Geldenhuys
to Unknown author

2009/10/2 :

Show quoted text 7 lines
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.

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.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Florian Klaempfl
to Graeme Geldenhuys
Show quoted text 13 lines
2009/10/2 : > 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.

Either we define it as wide- or UTF32Char which should fit most needs or we just use a string.

Reply by email

Unknown author
to Graeme Geldenhuys: 2009/10/2 : This is a know problem reported by me some months ago. Unfortunately there…
Graeme Geldenhuys wrote 13 lines
2009/10/2 : > 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

Reply by email