X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ftext-coding.c;h=e3fe8ffa888789ab4c6f4971aef45933ff82d926;hb=6b3f40dfa3d8f18a2fcc6932be7f82acd94261c2;hp=50a17fc442e029b26c7d1bb2be92310136822c4b;hpb=830f7f70b3b1a809d1f9f352159782b67c7c2058;p=chise%2Fxemacs-chise.git- diff --git a/src/text-coding.c b/src/text-coding.c index 50a17fc..e3fe8ff 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -2980,15 +2980,16 @@ char_encode_shift_jis (struct encoding_stream *str, Emchar ch, } else { - Lisp_Object charset; + Lisp_Object charset, value; unsigned int c1, c2, s1, s2; #ifdef UTF2000 - if ( (c1 = - get_byte_from_character_table - (ch, XCHARSET_TO_BYTE1_TABLE (Vcharset_latin_jisx0201))) ) + if (INTP (value = + get_char_code_table + (ch, XCHARSET_ENCODING_TABLE (Vcharset_latin_jisx0201)))) { charset = Vcharset_latin_jisx0201; + c1 = XINT (value); c2 = 0; } else @@ -4804,7 +4805,24 @@ char_encode_iso2022 (struct encoding_stream *str, Emchar ch, } } if (reg == -1) - BREAKUP_CHAR (ch, charset, byte1, byte2); + { + Lisp_Object original_default_coded_charset_priority_list + = Vdefault_coded_charset_priority_list; + + while (!EQ (Vdefault_coded_charset_priority_list, Qnil)) + { + BREAKUP_CHAR (ch, charset, byte1, byte2); + if (XCHARSET_FINAL (charset)) + goto found; + Vdefault_coded_charset_priority_list + = Fcdr (Fmemq (XCHARSET_NAME (charset), + Vdefault_coded_charset_priority_list)); + } + BREAKUP_CHAR (ch, charset, byte1, byte2); + found: + Vdefault_coded_charset_priority_list + = original_default_coded_charset_priority_list; + } ensure_correct_direction (XCHARSET_DIRECTION (charset), codesys, dst, flags, 0);