Hi Eric,

> since on the NetBSD system:
> 
> $ LC_ALL=fr_FR.ISO8859-1 locale -ck currency_symbol {p,n}_cs_precedes
> LC_MONETARY
> currency_symbol="Eu"
> LC_MONETARY
> p_cs_precedes=0
> LC_MONETARY
> n_cs_precedes=0
> 
> I argue that CRNCYSTR for fr_FR.ISO8859-1 MUST result in "+Eu", not the 
> empty string.
> 
> ... we 
> can probably work around it by querying the locale database with localeconv.

Yes, you're right. The localeconv() API gives information from which
nl_langinfo (CRNCYSTR) could be fixed.

But what's the point in doing that?
  - Anyone doing serious monetary formatting will use localeconv(),
    since it provides more detailed information than nl_langinfo (CRNCYSTR),
    or use strfmon() right away.
  - Anyone doing serious monetary formatting in a French locale will not
    use NetBSD, since it's "local currency symbol" is "Eu", even in the
    ISO-8859-15 locale - a value that is not seen in real life.

So I think that just documenting the problem is enough.

Bruno


2010-10-23  Bruno Haible  <br...@clisp.org>

        nl_langinfo: Mention problem with CRNCYSTR on NetBSD 5.0.
        * doc/posix-functions/nl_langinfo.texi: Mention problem with CRNCYSTR.
        Reported by Eric Blake.

--- doc/posix-functions/nl_langinfo.texi.orig   Sat Oct 23 14:47:41 2010
+++ doc/posix-functions/nl_langinfo.texi        Sat Oct 23 14:47:03 2010
@@ -32,4 +32,9 @@
 
 @item
 On Cygwin 1.7.0, only the charset portion of a locale designation is honored.
+
+...@item
+On NetBSD 5.0, in some locales, @code{nl_langinfo(CRNCYSTR)} returns the
+empty string, although the local currency symbol, as returned by
+...@code{localeconv()->currency_symbol}, is non-empty.
 @end itemize

Reply via email to