From 9584baa34da6ac33111cb8f72e7da2ec33b3ad02 Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 15 Jun 1999 06:44:49 +0000 Subject: [PATCH] (encode_coding_no_conversion): Modify for UTF2000. --- src/file-coding.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; -- 1.7.10.4