From: Eli Zaretskii Date: Sat, 21 Mar 2015 15:44:00 +0000 (+0200) Subject: Fix problems with setting system-time-locale on MS-Windows X-Git-Tag: emacs-25.0.90~2564^2~111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ad80180d0f2fc2ea422cf7ca5bdcc636c0600744;p=emacs.git Fix problems with setting system-time-locale on MS-Windows src/emacs.c (synchronize_locale) [WINDOWSNT]: Ignore 'category' and always use LC_ALL instead. Fixes problems with setting system-time-locale to something non-default. --- diff --git a/src/ChangeLog b/src/ChangeLog index bdec3c9cde1..5aa248e91b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2015-03-21 Eli Zaretskii + + * emacs.c (synchronize_locale) [WINDOWSNT]: Ignore 'category' and + always use LC_ALL instead. Fixes problems with setting + system-time-locale to something non-default. + 2015-03-18 Glenn Morris * frame.h (x_set_bitmap_icon): Don't set the icon if icon-type is diff --git a/src/emacs.c b/src/emacs.c index d318fd4649a..70db900246a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2152,6 +2152,13 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca { if (! EQ (*plocale, desired_locale)) { +#ifdef WINDOWSNT + /* Changing categories like LC_TIME usually requires to specify + an encoding suitable for the new locale, but MS-Windows's + 'setlocale' will only switch the encoding when LC_ALL is + specified. So we ignore CATEGORY and use LC_ALL instead. */ + category = LC_ALL; +#endif *plocale = desired_locale; setlocale (category, (STRINGP (desired_locale) ? SSDATA (desired_locale)