summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-03-21 17:44:00 +0200
committerEli Zaretskii <eliz@gnu.org>2015-03-21 17:44:00 +0200
commitad80180d0f2fc2ea422cf7ca5bdcc636c0600744 (patch)
tree64b1677bdaa9d79db58c15075971c5f37243bfbc /src/emacs.c
parent4a50af936e24b5f71df4079beb6dde82ed1955c2 (diff)
downloademacs-ad80180d0f2fc2ea422cf7ca5bdcc636c0600744.tar.gz
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.
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c7
1 files changed, 7 insertions, 0 deletions
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)