Package: grep;
Reported by: Jeremy Hetzler <jeremyhetzler <at> gmail.com>
Date: 2023年6月24日 21:24:02 UTC
Severity: wishlist
To reply to this bug, email your comments to 64277 AT debbugs.gnu.org.
the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-grep <at> gnu.org:bug#64277; Package grep.
(2023年6月24日 21:24:02 GMT) Full text and rfc822 format available.Jeremy Hetzler <jeremyhetzler <at> gmail.com>:bug-grep <at> gnu.org.
(2023年6月24日 21:24:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Jeremy Hetzler <jeremyhetzler <at> gmail.com> To: bug-grep <at> gnu.org Subject: [feature request] handle files encoded in utf-16le Date: 2023年6月24日 17:23:05 -0400
[Message part 1 (text/plain, inline)]
Maintainers, I recently was confused as to why GNU grep did not find any matches in certain files, when vim clearly showed that the search string was present. Turns out the files (log files from a Windows application) are encoded in UTF16-LE. $ file '06-21-2023 03-22-46' > 06-21-2023 03-22-46: Unicode text, UTF-16, little-endian text, with CRLF > line terminators > $ /bin/od -Ad -w16 -t cz '06-21-2023 03-22-46' | head -10 > 0000000 377 376 [ 0円 H 0円 E 0円 A 0円 D 0円 E 0円 R 0円 > >..[.H.E.A.D.E.R.< > 0000016 : 0円 ] 0円 \r 0円 \n 0円 [ 0円 I 0円 D 0円 r 0円 > >:.].....[.I.D.r.< > 0000032 i 0円 v 0円 e 0円 0円 v 0円 e 0円 r 0円 s 0円 > >i.v.e. .v.e.r.s.< > 0000048 i 0円 o 0円 n 0円 : 0円 0円 6 0円 . 0円 7 0円 > >i.o.n.:. .6...7.< > 0000064 . 0円 4 0円 . 0円 4 0円 6 0円 0円 R 0円 e 0円 > >..4...4.6. .R.e.< > 0000080 l 0円 e 0円 a 0円 s 0円 e 0円 0円 D 0円 a 0円 > >l.e.a.s.e. .D.a.< > 0000096 t 0円 e 0円 : 0円 0円 0 0円 6 0円 / 0円 1 0円 > >t.e.:. .0.6./.1.< > 0000112 6 0円 / 0円 2 0円 0 0円 2 0円 3 0円 ] 0円 \r 0円 > >6./.2.0.2.3.]...< > 0000128 \n 0円 [ 0円 I 0円 n 0円 t 0円 e 0円 r 0円 a 0円 > >..[.I.n.t.e.r.a.< > 0000144 c 0円 t 0円 i 0円 v 0円 e 0円 0円 B 0円 a 0円 > >c.t.i.v.e. .B.a.< > $ grep --version > grep (GNU grep) 3.11 > Packaged by Cygwin (3.11-1) > Copyright (C) 2023 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later < > https://gnu.org/licenses/gpl.html>. > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > There is no easy way to use grep to search these files, even if one knows the encoding in advance. I would like to request a feature to be added to grep which would enable it to transparently decode UTF16-LE files so they can be conveniently searched. Thanks, Jeremy Hetzler (he/him)
[Message part 2 (text/html, inline)]
bug-grep <at> gnu.org:bug#64277; Package grep.
(2023年6月24日 22:18:01 GMT) Full text and rfc822 format available.Message #8 received at 64277 <at> debbugs.gnu.org (full text, mbox):
From: Paul Eggert <eggert <at> cs.ucla.edu> To: Jeremy Hetzler <jeremyhetzler <at> gmail.com> Cc: 64277 <at> debbugs.gnu.org Subject: Re: bug#64277: [feature request] handle files encoded in utf-16le Date: 2023年6月24日 15:17:34 -0700
On 2023年06月24日 14:23, Jeremy Hetzler wrote: > I would like to request a feature to be added to grep which would enable it > to transparently decode UTF16-LE files so they can be conveniently searched. Not sure it's worth the effort as this format is not that common for GNU grep, it'd be a pain to add proper support for it, and anyway 16-bit encodings have been problematic ever since Unicode crossed the 16-bit Rubicon. I'm not saying we'd reject a patch if someone wrote it, but I'd say it should be low priority.
bug-grep <at> gnu.org:bug#64277; Package grep.
(2023年6月25日 16:55:02 GMT) Full text and rfc822 format available.Message #11 received at 64277 <at> debbugs.gnu.org (full text, mbox):
From: Jeremy Hetzler <jeremyhetzler <at> gmail.com> To: Paul Eggert <eggert <at> cs.ucla.edu> Cc: 64277 <at> debbugs.gnu.org Subject: Re: bug#64277: [feature request] handle files encoded in utf-16le Date: 2023年6月25日 12:53:31 -0400
[Message part 1 (text/plain, inline)]
Thanks Paul. I understand. Appreciate the quick response. Yours, Jeremy On Sat, Jun 24, 2023 at 6:17 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote: > On 2023年06月24日 14:23, Jeremy Hetzler wrote: > > I would like to request a feature to be added to grep which would enable > it > > to transparently decode UTF16-LE files so they can be conveniently > searched. > > Not sure it's worth the effort as this format is not that common for GNU > grep, it'd be a pain to add proper support for it, and anyway 16-bit > encodings have been problematic ever since Unicode crossed the 16-bit > Rubicon. I'm not saying we'd reject a patch if someone wrote it, but I'd > say it should be low priority. > -- Thanks, Jeremy Hetzler (he/him) 203-887-5398
[Message part 2 (text/html, inline)]
bug-grep <at> gnu.org:bug#64277; Package grep.
(2023年6月26日 08:04:02 GMT) Full text and rfc822 format available.Message #14 received at 64277 <at> debbugs.gnu.org (full text, mbox):
From: lacsaP Patatetom <patatetom <at> gmail.com> To: Jeremy Hetzler <jeremyhetzler <at> gmail.com> Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 64277 <at> debbugs.gnu.org Subject: Re: bug#64277: [feature request] handle files encoded in utf-16le Date: 2023年6月26日 10:03:27 +0200
[Message part 1 (text/plain, inline)]
Le dim. 25 juin 2023 à 18:55, Jeremy Hetzler <jeremyhetzler <at> gmail.com> a écrit : > Thanks Paul. > > I understand. Appreciate the quick response. > > Yours, > Jeremy > > On Sat, Jun 24, 2023 at 6:17 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote: > > > On 2023年06月24日 14:23, Jeremy Hetzler wrote: > > > I would like to request a feature to be added to grep which would > enable > > it > > > to transparently decode UTF16-LE files so they can be conveniently > > searched. > > > > Not sure it's worth the effort as this format is not that common for GNU > > grep, it'd be a pain to add proper support for it, and anyway 16-bit > > encodings have been problematic ever since Unicode crossed the 16-bit > > Rubicon. I'm not saying we'd reject a patch if someone wrote it, but I'd > > say it should be low priority. > > > > > -- > Thanks, > Jeremy Hetzler > (he/him) > 203-887-5398 > iconv -f utf-16le '06-21-2023 03-22-46' | grep regexp
[Message part 2 (text/html, inline)]
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.