Use locale coding system to decode XIM preedit text

* src/xfns.c (x_xim_text_to_utf8_unix): XIMs typically return
text in the locale coding system, so use that instead.
This commit is contained in:
Po Lu 2022-01-22 16:16:26 +08:00
parent 246557f33e
commit 2b72558527

View file

@ -3051,7 +3051,7 @@ x_xim_text_to_utf8_unix (XIMText *text, ptrdiff_t *length)
}
nbytes = strlen (text->string.multi_byte);
setup_coding_system (Qutf_8_unix, &coding);
setup_coding_system (Vlocale_coding_system, &coding);
coding.mode |= (CODING_MODE_LAST_BLOCK
| CODING_MODE_SAFE_ENCODING);
coding.source = (const unsigned char *) text->string.multi_byte;