Some details on the named locale problem

Paolo Carlini
Mon Jan 28 15:13:00 GMT 2002

Nathan Myers wrote:

> In the case where you get nonsense from the C library (or, more
> preferably, from its tables), you can substitute something reasonable.

Ok, thanks.

> For the case of a null thousands_sep, you can return the base
> class result (',').

Ah, ok. In a follow up patch to that I have posted moments ago (which fixes
seg-faults!) I will also adjust this, substituting NUL with ',' for the
thousands separator, after having inferred from NUL that grouping is "", as
indicated by Ulrich.

> If you get 0xff as the first character in
> the grouping, that is equivalent to the empty string.  "\003\003"
> is equivalent to a single "\003", but it's fairly harmless.
> (You might want to ignore all but the bottom 4 bits of each
> grouping character, in use, in case some idiot user passes "3"
> instead of "\003".)

I see. We can work on this soonish.

> For the long term it would be better to have our own code to read
> locale files, instead of relying on the C library.  On POSIX systems
> where you don't know the locale file format (or placement) you are
> at least guaranteed to have a program that will extract them to a
> standard format, which you can then compile into your own preferred
> format.  Thus, at "make install" you can generate optimal locale
> files for C++ use alone.  On GNU systems we can just read the
> C library's locale files directly because we know their format.

Nathan, we have a PR (libstdc++/5499) about truename and falsename,
un-implementable right now, if I understand well. What do you think about that?


P.S. As you may have noticed I CC-ed some messages directly to you today but had
them rejected by your mail server :-(

More information about the Libstdc++ mailing list