This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Named locales not ok for locales without thousands separator
On Mon, Jan 28, 2002 at 12:42:19PM -0800, Benjamin Kosnik wrote:
> > What does it mean for a locale to have "no" thousands separator?
>
> I believe it's like this.
>
> You'll see p set to '0', not what you're probably expecting. You might
> want to talk to people on the "C" library list to see how you could help
> flesh out the it_IT locale data. (I've cc'd Ulrich, perhaps he can tell
> you.)
If the locale actually specifies a NUL thousands separator,
then the library should be able to really generate numbers with NUL
group separators. The test case to verify it can use one of the
string constructors that ignores nulls, e.g.
assert(str.str() == std::string("1\00023\00045", 7));
The library is supposed to allow NUL characters anywhere they
aren't actually needed to terminate a C-style string in an
interface. Any case where it can't, or treats a NUL as a
terminator internally, is a serious error.
Nathan Myers
ncm at cantrip dot org