1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3-net: Bind our gettext results to 'unix charset'

This ensures that the translations and any embedded strings are in the
same charset.  It won't be the one from the user's locale (we no
longer auto-detect that), but it will be self-consistent.

Thanks to Steve Langasek for pointing this function out!

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2011-06-22 10:40:26 +10:00
parent fb3d5ade9d
commit 4d2c56c4b1
3 changed files with 12 additions and 2 deletions

View File

@ -1100,7 +1100,7 @@ AC_CHECK_HEADERS(sys/mman.h)
# setbuffer, shmget, shm_open are needed for smbtorture
AC_CHECK_FUNCS(shmget shm_open)
AC_CHECK_FUNCS(gettext dgettext)
AC_CHECK_FUNCS(bindtextdomain textdomain)
AC_CHECK_FUNCS(bindtextdomain textdomain bind_textdomain_codeset)
AC_CHECK_FUNCS(strupr)
# Find a method of generating a stack trace

View File

@ -880,6 +880,16 @@ static struct functable net_func[] = {
lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
/* Bind our gettext results to 'unix charset'
This ensures that the translations and any embedded strings are in the
same charset. It won't be the one from the user's locale (we no
longer auto-detect that), but it will be self-consistent.
*/
bind_textdomain_codeset(MODULE_NAME, lp_unix_charset());
#endif
argv_new = (const char **)poptGetArgs(pc);
argc_new = argc;

View File

@ -138,7 +138,7 @@ def configure(conf):
conf.CHECK_FUNCS('memalign posix_memalign hstrerror')
conf.CHECK_FUNCS('shmget')
conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain')
conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain bind_textdomain_codeset')
#FIXME: for some reason this one still fails
conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl')
conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv')