From: tomo Date: Sat, 11 Sep 1999 09:51:51 +0000 (+0000) Subject: (char_encode_shift_jis): Use table `ucs_to_latin_jisx0201' and X-Git-Tag: r21-2-19-utf-2000-0_7-0~41 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=193e4db6b92418318b351d358c37c448d2cfad05;p=chise%2Fxemacs-chise.git.1 (char_encode_shift_jis): Use table `ucs_to_latin_jisx0201' and BREAKUP_CHAR. --- diff --git a/src/text-coding.c b/src/text-coding.c index f505c0e..1e12bd4 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -2979,28 +2979,37 @@ char_encode_shift_jis (struct encoding_stream *str, Emchar ch, if (eol_type != EOL_CR) Dynarr_add (dst, ch); } - else if (ch <= 0x7f) - Dynarr_add (dst, ch); - else if (ch == 0xA5) - Dynarr_add (dst, 0x5C); - else if (ch == 0X203E) - Dynarr_add (dst, 0x7E); else { Lisp_Object charset; unsigned int c1, c2, s1, s2; - - BREAKUP_CHAR (ch, charset, c1, c2); + +#ifdef UTF2000 + if ( (c1 = get_byte_from_character_table (ch, ucs_to_latin_jisx0201)) ) + { + charset = Vcharset_latin_jisx0201; + c2 = 0; + } + else +#endif + BREAKUP_CHAR (ch, charset, c1, c2); + if (EQ(charset, Vcharset_katakana_jisx0201)) { Dynarr_add (dst, c1 | 0x80); } + else if (c2 == 0) + { + Dynarr_add (dst, c1); + } else if (EQ(charset, Vcharset_japanese_jisx0208)) { ENCODE_SJIS (c1 | 0x80, c2 | 0x80, s1, s2); Dynarr_add (dst, s1); Dynarr_add (dst, s2); } + else + Dynarr_add (dst, '?'); } }