From: Jeremy Allison Date: Fri, 10 Dec 2004 05:49:48 +0000 (+0000) Subject: r4126: Fix from Björn Jacke for bugid #2040 - ensure the locale X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5511 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e1b1693abf1e6eb46b23a5fa56776fc2ede7982;p=thirdparty%2Fsamba.git r4126: Fix from Björn Jacke for bugid #2040 - ensure the locale is reset to C to get ASCII-compatible toupper/lower functions. Jeremy. --- diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index e8ceaf39b78..b9b9d90db67 100644 --- a/source/lib/charcnv.c +++ b/source/lib/charcnv.c @@ -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";