]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r4126: Fix from Björn Jacke <bjoern@j3e.de> for bugid #2040 - ensure the locale
authorJeremy Allison <jra@samba.org>
Fri, 10 Dec 2004 05:49:48 +0000 (05:49 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:35 +0000 (10:53 -0500)
is reset to C to get ASCII-compatible toupper/lower functions.
Jeremy.

source/lib/charcnv.c

index e8ceaf39b7859df8aad3e6896fc6af2559937498..b9b9d90db670e017905b597a90bd6eac76b9530d 100644 (file)
@@ -84,6 +84,15 @@ static const char *charset_name(charset_t ch)
                }
                ret = ln;
        }
+#ifdef HAVE_SETLOCALE
+       /* We set back the locale to C to get ASCII-compatible toupper/lower functions.
+          For now we do not need any other POSIX localisations anyway. When we should
+          really need localized string functions one day we need to write our own
+          ascii_tolower etc.
+       */
+       setlocale(LC_ALL, "C");
+ #endif
+
 #endif
 
        if (!ret || !*ret) ret = "ASCII";