From: Andrey Repin <anrdaemon@yandex.ru>
To: Ronald Fischer <ynnor@mm.st>, cygwin@cygwin.com
Subject: Re: Bug: grep behaves incorrectly under the locale C.UTF-8, if a file contains Umlaut characters
Date: Wed, 24 May 2017 10:05:00 -0000 [thread overview]
Message-ID: <1221683706.20170524130359@yandex.ru> (raw)
In-Reply-To: <1495612367.2760331.986814392.79C77EB2@webmail.messagingengine.com>
Greetings, Ronald Fischer!
> I have a file X which contains ASCII text, but also in some lines German
> umlaut characters. The file is classified as:
> $ file X
> X: ISO-8859 text, with CRLF line terminators
> If I grep the file using, say,
> $ grep . X >Y
> (i.e. select every non-empty line and write the result to Y), this works
> fine, if LANG is set to one of: UTF-8, C, C.de_DE, C.en_EN, en_EN,
> de_DE.
> However, if LANG is set to C.UTF-8, two things happen:
> - grep classifies the file as binary file and produces the error message
> "Binary file X matches"
This is an intended behavior, upstream decision since mid-2015, I recall.
> - Both the grepped lines (i.e. in our example the non-empty lines) AND
> the error message end up in the standard output (i.e. in file Y).
> IMO, there are several problems with this:
> 1. It's hard to see, why an umlaut character makes the file X binary
> under encoding C.UTF-8, but not under encoding UTF-8 or C.en_EN
> 2. If grep classifies a file as binary, I think the desired behaviour
> would be to NOT produce any output, unless the -a flag has been
> supplied.
> 3. If grep writes a message "Binary file ... matches", this message
> should go to stderr, not stdout. The stdout is supposed to contain only
> a subset of the input lines.
> Ronald
--
With best regards,
Andrey Repin
Wednesday, May 24, 2017 13:02:39
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2017-05-24 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 8:30 Ronald Fischer
2017-05-24 10:05 ` Andrey Repin [this message]
2017-05-24 10:20 ` Ronald Fischer
2017-05-24 11:42 ` Erik Bray
2017-05-24 12:33 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1221683706.20170524130359@yandex.ru \
--to=anrdaemon@yandex.ru \
--cc=cygwin@cygwin.com \
--cc=ynnor@mm.st \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).