diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/emacs.c b/src/emacs.c index 6e35496eb8a..aace618b300 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -2154,17 +2154,23 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca | |||
| 2154 | { | 2154 | { |
| 2155 | if (! EQ (*plocale, desired_locale)) | 2155 | if (! EQ (*plocale, desired_locale)) |
| 2156 | { | 2156 | { |
| 2157 | *plocale = desired_locale; | ||
| 2157 | #ifdef WINDOWSNT | 2158 | #ifdef WINDOWSNT |
| 2158 | /* Changing categories like LC_TIME usually requires to specify | 2159 | /* Changing categories like LC_TIME usually requires to specify |
| 2159 | an encoding suitable for the new locale, but MS-Windows's | 2160 | an encoding suitable for the new locale, but MS-Windows's |
| 2160 | 'setlocale' will only switch the encoding when LC_ALL is | 2161 | 'setlocale' will only switch the encoding when LC_ALL is |
| 2161 | specified. So we ignore CATEGORY and use LC_ALL instead. */ | 2162 | specified. So we ignore CATEGORY, use LC_ALL instead, and |
| 2162 | category = LC_ALL; | 2163 | then restore LC_NUMERIC to "C", so reading and printing |
| 2163 | #endif | 2164 | numbers is unaffected. */ |
| 2164 | *plocale = desired_locale; | 2165 | setlocale (LC_ALL, (STRINGP (desired_locale) |
| 2166 | ? SSDATA (desired_locale) | ||
| 2167 | : "")); | ||
| 2168 | fixup_locale (); | ||
| 2169 | #else /* !WINDOWSNT */ | ||
| 2165 | setlocale (category, (STRINGP (desired_locale) | 2170 | setlocale (category, (STRINGP (desired_locale) |
| 2166 | ? SSDATA (desired_locale) | 2171 | ? SSDATA (desired_locale) |
| 2167 | : "")); | 2172 | : "")); |
| 2173 | #endif /* !WINDOWSNT */ | ||
| 2168 | } | 2174 | } |
| 2169 | } | 2175 | } |
| 2170 | 2176 | ||