diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index aedac4714db..8b6b98019c6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6950,6 +6950,28 @@ same_x_server (name1, name2) | |||
| 6950 | } | 6950 | } |
| 6951 | #endif | 6951 | #endif |
| 6952 | 6952 | ||
| 6953 | #if defined (HAVE_X_I18N) || (defined (USE_X_TOOLKIT) && defined (HAVE_X11XTR6)) | ||
| 6954 | /* Recover from setlocale (LC_ALL, ""). */ | ||
| 6955 | static void | ||
| 6956 | fixup_locale () | ||
| 6957 | { | ||
| 6958 | /* Currently we require strerror to use the "C" locale, | ||
| 6959 | since we don't yet support decoding its string result. */ | ||
| 6960 | #ifdef LC_MESSAGES | ||
| 6961 | setlocale (LC_MESSAGES, "C"); | ||
| 6962 | #endif | ||
| 6963 | |||
| 6964 | /* The Emacs Lisp reader needs LC_NUMERIC to be "C", | ||
| 6965 | so that numbers are read and printed properly for Emacs Lisp. */ | ||
| 6966 | setlocale (LC_NUMERIC, "C"); | ||
| 6967 | |||
| 6968 | /* Currently we require strftime to use the "C" locale, | ||
| 6969 | since we don't yet support encoding its format argument, | ||
| 6970 | or decoding its string result. */ | ||
| 6971 | setlocale (LC_TIME, "C"); | ||
| 6972 | } | ||
| 6973 | #endif | ||
| 6974 | |||
| 6953 | struct x_display_info * | 6975 | struct x_display_info * |
| 6954 | x_term_init (display_name, xrm_option, resource_name) | 6976 | x_term_init (display_name, xrm_option, resource_name) |
| 6955 | Lisp_Object display_name; | 6977 | Lisp_Object display_name; |
| @@ -6973,8 +6995,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 6973 | 6995 | ||
| 6974 | #ifdef HAVE_X_I18N | 6996 | #ifdef HAVE_X_I18N |
| 6975 | setlocale (LC_ALL, ""); | 6997 | setlocale (LC_ALL, ""); |
| 6976 | /* In case we just overrode what init_lread did, redo it. */ | 6998 | fixup_locale (); |
| 6977 | setlocale (LC_NUMERIC, "C"); | ||
| 6978 | #endif | 6999 | #endif |
| 6979 | 7000 | ||
| 6980 | #ifdef USE_X_TOOLKIT | 7001 | #ifdef USE_X_TOOLKIT |
| @@ -7005,7 +7026,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 7005 | 7026 | ||
| 7006 | #ifdef HAVE_X11XTR6 | 7027 | #ifdef HAVE_X11XTR6 |
| 7007 | /* I think this is to compensate for XtSetLanguageProc. */ | 7028 | /* I think this is to compensate for XtSetLanguageProc. */ |
| 7008 | setlocale (LC_NUMERIC, "C"); | 7029 | fixup_locale (); |
| 7009 | #endif | 7030 | #endif |
| 7010 | } | 7031 | } |
| 7011 | 7032 | ||