diff src/coding.c @ 34536:aa667988f2b0

(decode_coding_string): Set coding->src_multibyte and coding->dst_multibyte before calling detect_coding and detect_eol. Update them after some coding system is detected.
author Kenichi Handa <handa@m17n.org>
date Thu, 14 Dec 2000 01:27:43 +0000
parents 37f85e931855
children 9d5d795f9315
line wrap: on
line diff
--- a/src/coding.c	Thu Dec 14 01:27:24 2000 +0000
+++ b/src/coding.c	Thu Dec 14 01:27:43 2000 +0000
@@ -5328,6 +5328,8 @@
   to_byte = STRING_BYTES (XSTRING (str));
 
   saved_coding_symbol = Qnil;
+  coding->src_multibyte = STRING_MULTIBYTE (str);
+  coding->dst_multibyte = 1;
   if (CODING_REQUIRE_DETECTION (coding))
     {
       /* See the comments in code_convert_region.  */
@@ -5350,9 +5352,10 @@
 	}
     }
 
-  coding->src_multibyte = 0;
-  coding->dst_multibyte = (coding->type != coding_type_no_conversion
-			   && coding->type != coding_type_raw_text);
+  if (coding->type == coding_type_no_conversion
+      || coding->type == coding_type_raw_text)
+    coding->dst_multibyte = 0;
+
   require_decoding = CODING_REQUIRE_DECODING (coding);
 
   if (STRING_MULTIBYTE (str))
@@ -5361,6 +5364,7 @@
       str = Fstring_as_unibyte (str);
       to_byte = STRING_BYTES (XSTRING (str));
       nocopy = 1;
+      coding->src_multibyte = 0;
     }
 
   /* Try to skip the heading and tailing ASCIIs.  */