emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 26.1.50; Emacs can't decode the text file on opening the file, but c


From: Eli Zaretskii
Subject: Re: 26.1.50; Emacs can't decode the text file on opening the file, but can decode it on revert-buffer
Date: Sun, 04 Nov 2018 19:13:36 +0200

> From: Zhang Haijun <address@hidden>
> CC: "address@hidden" <address@hidden>
> Date: Sun, 4 Nov 2018 15:14:07 +0000
> 
> > It's a subtle bug: revert-buffer reads and decodes the file in small
> > chunks, so by the time it gets to the furst null byte, it already
> > decided that the encoding is UTF-8.  By contrast, find-file decodes
> > the entire file at once, so it sees the null bytes when it detects the
> > encoding.
> > 
> > We had this behavior since Emacs 23.1; Emacs 22 doesn't change the
> > encoding when this buffer is reverted.
> 
> OK. Thanks for your explanation. I like the behavior of revert-buffer. 
> It may be useful to print some warning message when there are invalid bytes.
> How to search invalid bytes in buffer?

They are not invalid bytes, they are zero bytes.  You can search for
them like this:

  C-s C-q C-SPC



reply via email to

[Prev in Thread] Current Thread [Next in Thread]