GNU bug report logs - #69718
29.2; grep japanese-iso-8bit-unix string fails with "grep: illegal byte sequence"

Previous Next

Package: emacs;

Reported by: Akira Shirai <okshirai <at> gmail.com>

Date: Sun, 10 Mar 2024 23:49:01 UTC

Severity: normal

Found in version 29.2

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Akira Shirai <okshirai <at> gmail.com>
Cc: okshirai <at> joy.ocn.ne.jp, 69718 <at> debbugs.gnu.org
Subject: bug#69718: 29.2; grep japanese-iso-8bit-unix string fails with "grep: illegal byte sequence"
Date: Tue, 12 Mar 2024 21:39:03 +0200
> From: Akira Shirai <okshirai <at> gmail.com>
> Date: Wed, 13 Mar 2024 00:42:22 +0900
> Cc: 69718 <at> debbugs.gnu.org,
>  okshirai <at> joy.ocn.ne.jp
> 
> emacs-29.1 executes /usr/bin/grep without LANG,
> but emacs-29.2 seems to execute /usr/bin/grep with LANG=en_US.UTF-8.

The fact that LANG could cause this is IMO a bug in macOS's Grep.

There's no problem for Emacs to put LANG into the environment, but
Grep can be invoked on several very different files, with no single
LANG that fits all of them.  Grep should not use LANG at all.

> I wonder /usr/bin/grep should be invoked in non UTF-8 mode, because emacs might pass non UTF-8 byte sequence to /usr/bin/grep.

Illegal byte sequence is not limited to UTF-8.  There really is no
good solution for this, except in Grep itself.  Which is why I don't
think this is an Emacs bug.




This bug report was last modified 1 year and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.