Don Cragun wrote:
> >Date: Mon, 14 Jan 2008 22:00:36 -0500
> >From: Glenn Fowler <gsf at research.att.com>
> >
> >ast uses localeconv(3)
> >but
> >it assumes the struct lconv char* elements point to one byte
> >we will recode to properly treat the return as 0-terminated strings
> >
> >it will be up to the native localeconv() implementation
> >to do the right thing
> >
> >I just checked on sol11 and for LC_ALL=ar_SA.UTF-8
> >struct lconv decimal_point = ","
> 
> Glenn & Roland,
>         The C99 Standard (Subclause 7.11.2.1 "The localeconv function")
> says that the character string pointed to by char *decimal_point and
> char *thousands_sep in struct lconv contain "The decimal-point
> character used to format nonmonetary quantities." and "The character
> used to separate groups of digits before the decimal-point character in
> formatted nonmonetary quantities.", respectively.   Note that in the C
> Standard, "character" is a single-byte character.  Corresponding to
> this, the POSIX standard in the description of Locale Definition file
> (XBD Subclause 7.3.4 "LC_NUMERIC", P146, L4948-4949 & L4952-4954) we
> have: "In contexts where standards limit the decimal_point to a single
> byte, the result of specifying a multi-byte operand shall be
> unspecified." and "In contexts where standards limit the thousands_sep
> to a single byte, the result of specifying a multi-byte operand shall
> be unspecified."
>         So, in general, struct lconv char* elements are strings which
> may contain zero or more characters before the terminating null, but
> the decimal_point and thousands_sep fields aren't quite as free.

Erm... but the resposibilty is on the side of the party which fills
|struct lconv|, right ? AFAIK it should work like this: If |struct
lconv| contains multibyte characters then the consuming application
should output |decimal_point| and |thousands_sep| that way... or not ?

BTW: Would it be usefull to split the current locale into
1) ar_SA.UTF-8 (uses ASCII characters for |decimal_point| and
|thousands_sep|)
    and
2) ar_SA.UTF-8 at ar_numeric (uses multibyte characters (to represent these
characters as arabic (multibyte) characters) for |decimal_point| and
|thousands_sep|)

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to