This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: setlocale calls in binutils
- To: Bruno Haible <haible at ilog dot fr>
- Subject: Re: setlocale calls in binutils
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Tue, 30 May 2000 12:04:55 -0700
- Cc: Ian Lance Taylor <ian at cygnus dot com>, binutils at sourceware dot cygnus dot com
- References: <14644.4009.428294.869616@honolulu.ilog.fr>
On Tue, May 30, 2000 at 08:59:53PM +0200, Bruno Haible wrote:
> Hi,
>
> The gettext() functions in glibc 2.2 will - in order to function
> correctly - require that the locale facets LC_MESSAGES and LC_CTYPE be
> set according to the environment variables. Up to now only LC_MESSAGES
> was required. LC_CTYPE is now needed for converting the message to the
> proper character set, possibly doing transliteration along the way.
>
> The binutils programs mostly use the following piece of code:
>
> #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
> setlocale (LC_MESSAGES, "");
> #endif
> bindtextdomain (PACKAGE, LOCALEDIR);
> textdomain (PACKAGE);
>
> It will have to be changed to
>
> #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
> setlocale (LC_MESSAGES, "");
> #endif
> #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_CTYPE)
> setlocale (LC_CTYPE, "");
> #endif
> bindtextdomain (PACKAGE, LOCALEDIR);
> textdomain (PACKAGE);
>
> But then there are many calls to LC_CTYPE sensitive functions, like
> isdigit or isgraph, in the sources. I think most of them assume a
> standard C locale. Therefore they should be replaced with calls to
> functions C_isdigit, C_isgraph, etc. which provide the behaviour of
> the C locale even if the actual user's locale is different (chinese,
> multibyte or whatever).
>
> May I send you patches to that effect?
Could you post your patches to the binutils mailing list?
Thanks.
H.J.