1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

r4123: set locale to C to ensure ascii string functions work

thanks to Bjoern JACKE <samba@j3e.de> for pointing this out
(This used to be commit 53c4d0a7d83181afbe01bbbb0840cb2a086b45da)
This commit is contained in:
Andrew Tridgell 2004-12-10 03:41:54 +00:00 committed by Gerald (Jerry) Carter
parent b71dba6a76
commit 06fbfade75
2 changed files with 13 additions and 0 deletions

View File

@ -424,6 +424,8 @@ AC_CHECK_FUNCS(syscall)
AC_CHECK_FUNCS(getdents)
AC_CHECK_FUNCS(pread pwrite)
# needed for lib/charcnv.c
AC_CHECK_FUNCS(setlocale)
#
# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX

View File

@ -88,6 +88,17 @@ static smb_iconv_t get_conv_handle(charset_t from, charset_t to)
to look at */
if (initialised == 0) {
initialised = 1;
#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
atexit(init_iconv);
}