From: tomo Date: Mon, 14 Jun 2004 07:10:38 +0000 (+0000) Subject: (m2c): Fix problem with XEmacs CHISE. X-Git-Tag: r21-4-14-chise-0_21-29^2~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6486b5664ee8c49a6cb6c9f0a39aa9da0764e108;p=chise%2Fxemacs-chise.git (m2c): Fix problem with XEmacs CHISE. --- diff --git a/src/mule-canna.c b/src/mule-canna.c index 49db237..c2eb8d3 100644 --- a/src/mule-canna.c +++ b/src/mule-canna.c @@ -1891,7 +1891,6 @@ m2c (unsigned char *mp, int l, unsigned char *cp) { unsigned char ch, *ep = mp + l; #ifdef UTF2000 - unsigned char fb; int len; Emchar chr; #endif @@ -1936,25 +1935,31 @@ m2c (unsigned char *mp, int l, unsigned char *cp) } if ( chr <= 0x7f ) *cp++ = chr; - else if ( chr <= MAX_CHAR_HALFWIDTH_KATAKANA ) - { - *cp++ = ISO_CODE_SS2; - *cp++ = ( chr & 0x7f ) | 0x80; - } else { - Lisp_Object charset; - int c1, c2; + int code; - BREAKUP_CHAR (chr, charset, c1, c2); - fb = XCHARSET_FINAL (charset); - switch (fb) + if ( (code + = charset_code_point (Vcharset_japanese_jisx0208, + chr, 0)) >= 0 ) + { + *cp++ = (code >> 8) | 0x80; + *cp++ = (code & 0xFF) | 0x80; + } + else if ( (code + = charset_code_point (Vcharset_katakana_jisx0201, + chr, 0)) >= 0 ) + { + *cp++ = ISO_CODE_SS2; + *cp++ = code | 0x80; + } + else if ( (code + = charset_code_point (Vcharset_japanese_jisx0212, + chr, 0)) >= 0 ) { - case 'D': *cp++ = ISO_CODE_SS3; - default: - *cp++ = c1; - *cp++ = c2; + *cp++ = (code >> 8) | 0x80; + *cp++ = (code & 0xFF) | 0x80; } } #else