# HG changeset patch # User Kenichi Handa # Date 1082429198 0 # Node ID 1763eef5ad02a1944863d06b585beaba4595d9a1 # Parent e0e4e6a0599f00960217452ed97012e65bebd950 (encode_coding_utf_8): Fix handling of raw-byte char. (consume_chars): Fix handling of 8-bit bytes in unibyte source. diff -r e0e4e6a0599f -r 1763eef5ad02 src/coding.c --- a/src/coding.c Mon Apr 19 20:08:38 2004 +0000 +++ b/src/coding.c Tue Apr 20 02:46:38 2004 +0000 @@ -1349,7 +1349,10 @@ { ASSURE_DESTINATION (safe_room); c = *charbuf++; - dst += CHAR_STRING (c, dst); + if (CHAR_BYTE8_P (c)) + *dst++ = CHAR_TO_BYTE8 (c); + else + dst += CHAR_STRING (c, dst); produced_chars++; } } @@ -6379,11 +6382,10 @@ { EMACS_INT bytes; - if (! CODING_FOR_UNIBYTE (coding) - && (bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) + if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) c = STRING_CHAR_ADVANCE (src), pos += bytes; else - c = *src++, pos++; + c = BYTE8_TO_CHAR (*src), src++, pos++; } else c = STRING_CHAR_ADVANCE (src), pos++;