From 66683c49a1ff6aa6b2fc50ec816770d6634a7593 Mon Sep 17 00:00:00 2001 From: tomo Date: Sat, 10 Aug 2002 10:58:17 +0000 Subject: [PATCH] (decode_coding_big5): Support entity-reference decoding feature. --- src/text-coding.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/text-coding.c b/src/text-coding.c index 1d8d6f2..b9f3b20 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -3811,14 +3811,33 @@ decode_coding_big5 (Lstream *decoding, const Extbyte *src, { DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); if (BYTE_BIG5_TWO_BYTE_1_P (c)) - cpos = c; + { + decode_flush_er_chars (str, dst); + cpos = c; + } + else if ( c >= ' ' ) + { + /* DECODE_ADD_BINARY_CHAR (c, dst); */ + decode_add_er_char (str, c, dst); + } else - DECODE_ADD_BINARY_CHAR (c, dst); + { + decode_flush_er_chars (str, dst); + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + DECODE_ADD_BINARY_CHAR (c, dst); + } } label_continue_loop:; } - DECODE_HANDLE_END_OF_CONVERSION (flags, cpos, dst); + /* DECODE_HANDLE_END_OF_CONVERSION (flags, cpos, dst); */ + if (flags & CODING_STATE_END) + { + decode_flush_er_chars (str, dst); + DECODE_OUTPUT_PARTIAL_CHAR (cpos); + if (flags & CODING_STATE_CR) + Dynarr_add (dst, '\r'); + } str->flags = flags; str->cpos = cpos; -- 1.7.10.4