From 81a268b48ca7990868f4f75589789afcff29c077 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 3 Mar 2002 20:06:11 +0000 Subject: [PATCH] (read1): When reading from a file, default string to multibyte only if it has some multibyte characters. --- src/lread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lread.c b/src/lread.c index 10baf509918..5fa76b08280 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2260,9 +2260,11 @@ read1 (readcharfun, pch, first_in_list) 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 -- 2.39.5