From: tomo Date: Tue, 15 Jun 1999 06:44:49 +0000 (+0000) Subject: (encode_coding_no_conversion): Modify for UTF2000. X-Git-Tag: r21-2-15-utf2000-0_2-1~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9584baa34da6ac33111cb8f72e7da2ec33b3ad02;p=chise%2Fxemacs-chise.git- (encode_coding_no_conversion): Modify for UTF2000. --- diff --git a/src/file-coding.c b/src/file-coding.c index b310424..640fb0c 100644 --- a/src/file-coding.c +++ b/src/file-coding.c @@ -5362,9 +5362,25 @@ encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, } else if (BYTE_ASCII_P (c)) { +#ifdef UTF2000 + ch =0; +#else assert (ch == 0); +#endif Dynarr_add (dst, c); } +#ifdef UTF2000 + else if ( (0xc0 <= c) && (c < 0xe0) ) + ch = c; + else + { + c = ((ch & 0x1f) << 6) | (c & 0x3f); + if ( c <= 0xff ) + Dynarr_add (dst, c); + else + Dynarr_add (dst, '~'); /* untranslatable character */ + } +#else /* not UTF2000 */ else if (BUFBYTE_LEADING_BYTE_P (c)) { assert (ch == 0); @@ -5387,6 +5403,7 @@ encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, untranslatable character, so ignore it */ ch = 0; } +#endif /* not UTF2000 */ } str->flags = flags;