setlocale calls in binutils

H . J . Lu hjl@lucon.org
Tue May 30 12:05:00 GMT 2000


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.


More information about the Binutils mailing list