From 3c5a53bdceac9d8b81afdee50b6b9098ef5ec094 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 31 Jul 2002 07:06:36 +0000 Subject: [PATCH] (Funibyte_char_to_multibyte): If C can't be decoded by the primary charset, make it eight-bit char. (Fmultibyte_char_to_unibyte): Call CHAR_TO_BYTE8. --- src/character.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/character.c b/src/character.c index 5907f55b1f3..6e2b28a495f 100644 --- a/src/character.c +++ b/src/character.c @@ -247,7 +247,7 @@ the current primary charset (value of `charset-primary'). */) charset = CHARSET_FROM_ID (charset_primary); c = DECODE_CHAR (charset, c); if (c < 0) - error ("Can't convert to multibyte character: %d", XINT (ch)); + c = BYTE8_TO_CHAR (XFASTINT (ch)); return make_number (c); } @@ -260,17 +260,12 @@ the current primary charset (value of `charset-primary'). */) Lisp_Object ch; { int c; - unsigned code; struct charset *charset; CHECK_CHARACTER (ch); c = XFASTINT (ch); - charset = CHARSET_FROM_ID (charset_primary); - code = ENCODE_CHAR (charset, c); - if (code < CHARSET_MIN_CODE (charset) - || code > CHARSET_MAX_CODE (charset)) - error ("Can't convert to unibyte character: %d", XINT (ch)); - return make_number (code); + c = CHAR_TO_BYTE8 (c); + return make_number (c); } DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0, -- 2.39.5