From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Text copied from *grep* buffer has NUL (0x00) characters Date: Sun, 09 May 2021 13:01:39 +0300 Message-ID: <83bl9k8buk.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3104"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 12:02:45 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfgGq-0000kc-8z for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 12:02:44 +0200 Original-Received: from localhost ([::1]:51732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfgGp-0002bs-71 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 06:02:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfgFo-0002Zg-KI for help-gnu-emacs@gnu.org; Sun, 09 May 2021 06:01:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57464) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfgFo-00089p-C2 for help-gnu-emacs@gnu.org; Sun, 09 May 2021 06:01:40 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1329 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfgFn-000079-Qu for help-gnu-emacs@gnu.org; Sun, 09 May 2021 06:01:40 -0400 In-Reply-To: (rdiezmail-emacs@yahoo.de) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129609 Archived-At: > From: "R. Diez" > 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.