changeset 43669:4bd6b6b21deb

(read1): When reading from a file, default string to multibyte only if it has some multibyte characters.
author Richard M. Stallman <rms@gnu.org>
date Sun, 03 Mar 2002 20:06:11 +0000
parents 771bbdee433b
children 5505d571541b
files src/lread.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Sun Mar 03 20:04:17 2002 +0000
+++ b/src/lread.c	Sun Mar 03 20:06:11 2002 +0000
@@ -2260,9 +2260,11 @@
 	       compiled Emacs Lisp files, and those always use the
 	       Emacs internal encoding.  Meanwhile, Qlambda is used
 	       for reading dynamic byte code (compiled with
-	       byte-compile-dynamic = t).  */
+	       byte-compile-dynamic = t).  So make the string multibyte
+	       if the string contains any multibyte sequences.
+	       (to_multibyte is a no-op if not.)  */
 	    to_multibyte (&p, &end, &nchars);
-	    is_multibyte = 1;
+	    is_multibyte = (p - read_buffer) != nchars;
 	  }
 	else
 	  /* In all other cases, if we read these bytes as