From: tomo Date: Sat, 18 Sep 1999 02:43:07 +0000 (+0000) Subject: (char_encode_iso2022): Keep designated charsets if one of them X-Git-Tag: r21-2-19-utf-2000-0_8-1~11 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=830f7f70b3b1a809d1f9f352159782b67c7c2058;p=chise%2Fxemacs-chise.git (char_encode_iso2022): Keep designated charsets if one of them includes the specified character. --- diff --git a/src/text-coding.c b/src/text-coding.c index e5c9fe8..50a17fc 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -4787,23 +4787,27 @@ char_encode_iso2022 (struct encoding_stream *str, Emchar ch, { int reg; - BREAKUP_CHAR (ch, charset, byte1, byte2); - ensure_correct_direction (XCHARSET_DIRECTION (charset), - codesys, dst, flags, 0); - /* Now determine which register to use. */ reg = -1; for (i = 0; i < 4; i++) { - if (EQ (charset, str->iso2022.charset[i]) || - EQ (charset, - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i))) + if ((CHARSETP (charset = str->iso2022.charset[i]) + && (byte1 = charset_get_byte1 (charset, ch))) || + (CHARSETP + (charset + = CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)) + && (byte1 = charset_get_byte1 (charset, ch)))) { reg = i; + byte2 = charset_get_byte2 (charset, ch); break; } } - + if (reg == -1) + BREAKUP_CHAR (ch, charset, byte1, byte2); + ensure_correct_direction (XCHARSET_DIRECTION (charset), + codesys, dst, flags, 0); + if (reg == -1) { if (XCHARSET_GRAPHIC (charset) != 0)