From: tomo Date: Fri, 29 Oct 1999 03:52:36 +0000 (+0000) Subject: (char_encode_iso2022): Use `charset_code_point' instead of X-Git-Tag: r21-2-19-utf-2000-0_10-0~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f8c889244f022ae695ea8dc67267499286921903;hp=6ad9899c500e90d43b534a0c67d13b10bb3ddfb6;p=chise%2Fxemacs-chise.git (char_encode_iso2022): Use `charset_code_point' instead of `charset_get_byte1' and `charset_get_byte2'. --- diff --git a/src/text-coding.c b/src/text-coding.c index e3fe8ff..016f343 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -4792,15 +4792,33 @@ char_encode_iso2022 (struct encoding_stream *str, Emchar ch, reg = -1; for (i = 0; i < 4; i++) { + Lisp_Object code_point; + if ((CHARSETP (charset = str->iso2022.charset[i]) - && (byte1 = charset_get_byte1 (charset, ch))) || + && !EQ (code_point = charset_code_point (charset, ch), Qnil)) + || (CHARSETP (charset = CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)) - && (byte1 = charset_get_byte1 (charset, ch)))) + && !EQ (code_point = charset_code_point (charset, ch), Qnil))) { + Lisp_Object ret = Fcar (code_point); + + if (INTP (ret)) + { + byte1 = XINT (ret); + ret = Fcar (Fcdr (code_point)); + if (INTP (ret)) + byte2 = XINT (ret); + else + byte2 = 0; + } + else + { + byte1 = 0; + byte2 = 0; + } reg = i; - byte2 = charset_get_byte2 (charset, ch); break; } }