diff options
| author | Eli Zaretskii | 2015-03-21 17:44:00 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-03-21 17:44:00 +0200 |
| commit | ad80180d0f2fc2ea422cf7ca5bdcc636c0600744 (patch) | |
| tree | 64b1677bdaa9d79db58c15075971c5f37243bfbc /src | |
| parent | 4a50af936e24b5f71df4079beb6dde82ed1955c2 (diff) | |
| download | emacs-ad80180d0f2fc2ea422cf7ca5bdcc636c0600744.tar.gz emacs-ad80180d0f2fc2ea422cf7ca5bdcc636c0600744.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/emacs.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bdec3c9cde1..5aa248e91b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-03-21 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * emacs.c (synchronize_locale) [WINDOWSNT]: Ignore 'category' and | ||
| 4 | always use LC_ALL instead. Fixes problems with setting | ||
| 5 | system-time-locale to something non-default. | ||
| 6 | |||
| 1 | 2015-03-18 Glenn Morris <rgm@gnu.org> | 7 | 2015-03-18 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * frame.h (x_set_bitmap_icon): Don't set the icon if icon-type is | 9 | * 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 | |||
| 2152 | { | 2152 | { |
| 2153 | if (! EQ (*plocale, desired_locale)) | 2153 | if (! EQ (*plocale, desired_locale)) |
| 2154 | { | 2154 | { |
| 2155 | #ifdef WINDOWSNT | ||
| 2156 | /* Changing categories like LC_TIME usually requires to specify | ||
| 2157 | an encoding suitable for the new locale, but MS-Windows's | ||
| 2158 | 'setlocale' will only switch the encoding when LC_ALL is | ||
| 2159 | specified. So we ignore CATEGORY and use LC_ALL instead. */ | ||
| 2160 | category = LC_ALL; | ||
| 2161 | #endif | ||
| 2155 | *plocale = desired_locale; | 2162 | *plocale = desired_locale; |
| 2156 | setlocale (category, (STRINGP (desired_locale) | 2163 | setlocale (category, (STRINGP (desired_locale) |
| 2157 | ? SSDATA (desired_locale) | 2164 | ? SSDATA (desired_locale) |