From: Kenichi Handa Date: Wed, 31 Jul 2002 07:06:36 +0000 (+0000) Subject: (Funibyte_char_to_multibyte): If C can't be decoded X-Git-Tag: emacs-pretest-23.0.90~8295^2~1864^2~484 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3c5a53bdceac9d8b81afdee50b6b9098ef5ec094;p=emacs.git (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. --- 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,