This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Correctly localized strings
- To: binutils at sources dot redhat dot com
- Subject: Correctly localized strings
- From: Michal Svec <rebel at atrey dot karlin dot mff dot cuni dot cz>
- Date: Wed, 18 Apr 2001 15:18:58 +0200 (CEST)
Hi!
The strings program uses isprint function for recognition of printable
characters. This (glibc) function is localized correctly (according to
the locale returns correct result on local characters.
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).
And finally, use the isprint function, not isascii, as not all local
characters are ascii.
The (small) patch is attached.
Regards
Michal
--- binutils-2.10.91.0.4/binutils/strings.c.orig Tue Apr 10 09:47:15 2001
+++ binutils-2.10.91.0.4/binutils/strings.c Tue Apr 10 09:47:15 2001
@@ -76,11 +76,7 @@
#endif
#endif
-#ifdef isascii
-#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
-#else
#define isgraphic(c) (isprint (c) || (c) == '\t')
-#endif
#ifndef errno
extern int errno;
@@ -141,7 +137,7 @@
boolean files_given = false;
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
+ setlocale (LC_ALL, "");
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);