changeset 89917:1763eef5ad02

(encode_coding_utf_8): Fix handling of raw-byte char. (consume_chars): Fix handling of 8-bit bytes in unibyte source.
author Kenichi Handa <handa@m17n.org>
date Tue, 20 Apr 2004 02:46:38 +0000
parents e0e4e6a0599f
children 2d36fc270f24
files src/coding.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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++;