This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: setlocale calls in binutils


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]