diff src/process.c @ 31419:bd258f4dc0fa

(read_process_output): Before inserting the decoded text in the buffer, adjust the multibyteness.
author Kenichi Handa <handa@m17n.org>
date Thu, 07 Sep 2000 01:14:20 +0000
parents d1344c992a9a
children b148beb59511
line wrap: on
line diff
--- a/src/process.c	Thu Sep 07 01:14:02 2000 +0000
+++ b/src/process.c	Thu Sep 07 01:14:20 2000 +0000
@@ -3075,6 +3075,12 @@
       bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data,
 	     carryover);
       XSETINT (p->decoding_carryover, carryover);
+      /* Adjust the multibyteness of TEXT to that of the buffer.  */
+      if (NILP (current_buffer->enable_multibyte_characters)
+	  != ! STRING_MULTIBYTE (text))
+	text = (STRING_MULTIBYTE (text)
+		? Fstring_as_unibyte (text)
+		: Fstring_as_multibyte (text));
       nbytes = STRING_BYTES (XSTRING (text));
       nchars = XSTRING (text)->size;
       insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0);