[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Text copied from *grep* buffer has NUL (0x00) characters
From: |
Eli Zaretskii |
Subject: |
Re: Text copied from *grep* buffer has NUL (0x00) characters |
Date: |
Sun, 09 May 2021 13:01:39 +0300 |
> From: "R. Diez" <rdiezmail-emacs@yahoo.de>
> Date: Sun, 9 May 2021 11:19:38 +0200
>
> I would say that Emacs has 2 issues here:
>
>
> 1) If a text file encoding is utf-8-with-signature-dos, I do not think that
> it is a good idea for Emacs to allow binary zeros without any warning.
There's nothing wrong with null bytes in a UTF-8 encoded file, not in
general. We could have an optional warning about null bytes (when?
when you save the buffer?). But I see no reason to do that by
default, especially since such a feature would require a costly search
of the entire buffer.
> 2) Copying text from a *grep* buffer that looks like ":" should not suddenly
> deliver a NUL character instead. That's just unexpected and prone to
> problems down the line.
This is easy to fix: customize the Grep command to not include
"--null". That switch is mainly for systems that allow newlines in
file names, which MS-Windows doesn't allow, so if this switch causes
trouble in your usage, simply remove it.
Re: Text copied from *grep* buffer has NUL (0x00) characters, Stefan Monnier, 2021/05/09