comparison src/lread.c @ 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 a6382f0fcb2a
children 2388863b284b
comparison
equal deleted inserted replaced
43668:771bbdee433b 43669:4bd6b6b21deb
2258 { 2258 {
2259 /* Nowadays, reading directly from a file is used only for 2259 /* Nowadays, reading directly from a file is used only for
2260 compiled Emacs Lisp files, and those always use the 2260 compiled Emacs Lisp files, and those always use the
2261 Emacs internal encoding. Meanwhile, Qlambda is used 2261 Emacs internal encoding. Meanwhile, Qlambda is used
2262 for reading dynamic byte code (compiled with 2262 for reading dynamic byte code (compiled with
2263 byte-compile-dynamic = t). */ 2263 byte-compile-dynamic = t). So make the string multibyte
2264 if the string contains any multibyte sequences.
2265 (to_multibyte is a no-op if not.) */
2264 to_multibyte (&p, &end, &nchars); 2266 to_multibyte (&p, &end, &nchars);
2265 is_multibyte = 1; 2267 is_multibyte = (p - read_buffer) != nchars;
2266 } 2268 }
2267 else 2269 else
2268 /* In all other cases, if we read these bytes as 2270 /* In all other cases, if we read these bytes as
2269 separate characters, treat them as separate characters now. */ 2271 separate characters, treat them as separate characters now. */
2270 ; 2272 ;