This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Correctly localized strings
- To: Michal Svec <rebel at atrey dot karlin dot mff dot cuni dot cz>
- Subject: Re: Correctly localized strings
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 19 Apr 2001 09:36:42 +0100
- Cc: binutils at sources dot redhat dot com
- References: <Pine.LNX.4.21.0104181510170.8317-200000@atrey.karlin.mff.cuni.cz>
Hi Michal,
> However, it is needed to correctly initialize locales in the strings.
> Now, only messages are used (LC_MESSAGES), it is needed to init all
> locales (LC_ALL).
This first part of your patch seems fine.
> And finally, use the isprint function, not isascii, as not all local
> characters are ascii.
This second part has a problem though. On some, older, systems,
isprint() is only defiend to work on values that are accepted by
isascii() and using values outside of that range will produce
segmentation faults.
I think that perhaps this part of your patch:
> -#ifdef isascii
> -#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
> -#else
> #define isgraphic(c) (isprint (c) || (c) == '\t')
> -#endif
ought to be changed to:
> +#if defined isascii && ! defined HAVE_LOCALE_H
> #define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
> #else
> #define isgraphic(c) (isprint (c) || (c) == '\t')
> #endif
Does this work on your system ?
Cheers
Nick