From 6486b5664ee8c49a6cb6c9f0a39aa9da0764e108 Mon Sep 17 00:00:00 2001 From: tomo Date: Mon, 14 Jun 2004 07:10:38 +0000 Subject: [PATCH] (m2c): Fix problem with XEmacs CHISE. --- src/mule-canna.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) 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 -- 1.7.10.4