From 13c148b8e78d1ab7570f947d845c5bcb2c72e244 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 7 Aug 1998 05:04:36 +0000 Subject: [PATCH] (general_insert_function): If enable-multibyte-characters is nil, convert a multibyte character to unibyte appropriately. --- src/editfns.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/editfns.c b/src/editfns.c index c3cdad96aa0..fcf79d13431 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1326,7 +1326,13 @@ general_insert_function (insert_func, insert_from_string_func, if (!NILP (current_buffer->enable_multibyte_characters)) len = CHAR_STRING (XFASTINT (val), workbuf, str); else - workbuf[0] = XINT (val), str = workbuf, len = 1; + { + workbuf[0] = (SINGLE_BYTE_CHAR_P (XINT (val)) + ? XINT (val) + : multibyte_char_to_unibyte (XINT (val), Qnil)); + str = workbuf; + len = 1; + } (*insert_func) (str, len); } else if (STRINGP (val)) -- 2.39.2