Eli Zaretskii wrote:
> > > And could you please explain why this "must" is true:
> > > 
> > > > The reason why it does not work is that this program is not following
> > > > the documented requirement from
> > > > https://www.gnu.org/software/gettext/manual/html_node/C.html :
> > > >   "Programmer must call setlocale (LC_ALL, "")"
> > > 
> > > What's wrong with calling setlocale with second argument other than
> > > the empty string?
> > 
> > This way of doing things works only on some platforms, not on all platforms.
> > For the (complicated) reasons, see the comment re HAVE_LOCALE_NULL in
> > gnulib/lib/localename-unsafe.c.
> 
> Not sure I understand which comment you alluded to

The comment at [1].

> and how it answers
> my questions, so let me ask directly: are you saying that some systems
> don't support 'setlocale' with second argument anything other than "C"
> or the empty string, but do support changing the locale when
> 'setlocale' is called with empty string as the second argument and the
> actual locale is specified in the environment?

No, this is not what I'm saying.

setlocale() is a libc facility.

gettext() is a GNU libintl facility.

It is not the libc itself that prohibits us from using
  setlocale (category, name_of_locale)
It is that when a program does this, i.e. not call
  setlocale (category, "")
the GNU libintl facility cannot do its job properly on some specific systems,
as explained in [1].

Bruno

[1] 
https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/localename-unsafe.c;h=12748cba28becd2c8a999c8695cb42e0d0348940;hb=HEAD#l2717




            • ... pertusus
              • ... Gavin Smith
              • ... pertusus
              • ... Gavin Smith
              • ... Gavin Smith
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
          • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
            • ... Eli Zaretskii
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Eli Zaretskii
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Eli Zaretskii
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Gavin Smith
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
            • ... pertusus
      • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
        • ... Patrice Dumas
  • Re: ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
    • ... Patrice Dumas
      • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system

Reply via email to