* lisp/term/x-win.el (x-get-input-coding-system): Translate locales.
* src/xterm.c (x_term_init): If the X library doesn't support
the current locale, don't set up input methods.
(if (equal x-locale "C")
;; Treat the C locale specially, as it means "ascii" under X.
'ascii
- (let ((locale (downcase x-locale)))
+ (let ((locale (locale-translate (downcase x-locale))))
(or (locale-name-match locale locale-preferred-coding-systems)
(when locale
(if (string-match "\\.\\([^@]+\\)" locale)
#endif
#ifdef HAVE_X_I18N
- xim_initialize (dpyinfo, resource_name);
+ /* Avoid initializing input methods if the X library does not
+ support Emacs's locale. When the current locale is not
+ supported, decoding input method strings becomes undefined. */
+ if (!XSupportsLocale ())
+ xim_initialize (dpyinfo, resource_name);
#endif
xsettings_initialize (dpyinfo);