1399
1399
struct passwd *spasswd;
1402
/* It turns out that if we do NLS stuff here, people running in Japanese
1403
locales get font craziness on the password dialog, presumably because
1404
it is displaying Japanese characters in a non-Japanese font. I don't
1405
understand how to automatically make all this crap work properly by
1406
default, so until someone sends me a better patch, just leave it off
1407
and run the daemon in English. -- jwz, 29-Sep-2010
1402
/* It turns out that if we do setlocale (LC_ALL, "") here, people
1403
running in Japanese locales get font craziness on the password
1404
dialog, presumably because it is displaying Japanese characters
1405
in a non-Japanese font. However, if we don't call setlocale()
1406
at all, then XLookupString() never returns multi-byte UTF-8
1407
characters when people type non-Latin1 characters on the
1410
The current theory (and at this point, I'm really guessing!) is
1411
that using LC_CTYPE instead of LC_ALL will make XLookupString()
1412
behave usefully, without having the side-effect of screwing up
1413
the fonts on the unlock dialog.
1415
See https://bugs.launchpad.net/ubuntu/+source/xscreensaver/+bug/671923
1416
from comment #20 onward.
1411
1420
#ifdef ENABLE_NLS
1412
if (!setlocale (LC_ALL, ""))
1413
fprintf (stderr, "locale not supported by C library\n");
1421
if (!setlocale (LC_CTYPE, ""))
1422
fprintf (stderr, "%s: warning: could not set default locale\n",
1415
1425
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
1416
1426
textdomain (GETTEXT_PACKAGE);