diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-02-18 00:04:17 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-02-18 00:04:17 +0100 |
commit | 5de0053178b4acc793ae62838175e5f3ab56c603 (patch) | |
tree | 6d6d121a942bc161e87b3480380cf148a6be71ea /lib | |
parent | cac24946da089e1e1fddf9c9dc7ae7dae9e29014 (diff) |
Don't fail when locale env. vars specify a dot-less locale name.
Fixes <http://bugs.gnu.org/10742>.
Reported by Alírio Eyng <alirioeyng@ig.com.br>.
* gnulib-local/lib/localcharset.c.diff (environ_locale_charset): Change
to set CODESET to "" when LOCALE lacks a dot. Return "ISO-8859-1"
when CODESET is the empty string.
* lib/localcharset.c: Update.
* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
`test-command-line-encoding2'.
(TESTS): Likewise.
* test-suite/standalone/test-command-line-encoding2: New file.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/localcharset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/localcharset.c b/lib/localcharset.c index 47a6e5d5b..2c06328cb 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -589,9 +589,8 @@ environ_locale_charset (void) strcpy (buf, "ASCII"); return buf; } - - /* Resolve through the charset.alias file. */ - codeset = locale; + else + codeset = ""; } else codeset = ""; @@ -611,7 +610,8 @@ environ_locale_charset (void) the empty string as denoting "the locale's character encoding", thus GNU libiconv would call this function a second time. */ if (codeset[0] == '\0') - codeset = "ASCII"; + /* Default to Latin-1, for backward compatibility with Guile 1.8. */ + codeset = "ISO-8859-1"; return codeset; } |