[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `grep' command on MS Windows with Cygwin, looking for text with Unic
From: |
Noam Postavsky |
Subject: |
Re: `grep' command on MS Windows with Cygwin, looking for text with Unicode chars |
Date: |
Wed, 13 Jun 2018 15:16:10 -0400 |
On 13 June 2018 at 14:40, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Drew Adams <drew.adams@oracle.com> writes:
>
>> Is there a simple way to use `M-x grep' (e.g., giving it
>> some switches or escape chars or replacing them with hex
>> escapes or...) to search for some text that includes
>> non-ASCII Unicode chars?
> If there is a method, I'll like to know as well. This is the main reason
> why I don't use Unicode in my source files.
This seems to do the right with thing with the grep I have installed:
grep "[^[:cntrl:][:print:]]" *.el
According to the GNU grep manual [:cntrl:][:print:] looks equivalent
to Emacs' [:ascii:], in the C locale.
The grep I have installed doesn't seem to support anything but the C
locale anyway (at least, setting LANG isn't needed). It identifies
itself in the --help output as:
GNU grep version 2.0d
Win32 port with subdirectory search created by Tim Charron
(full source available at http://www.interlog.com/~tcharron/grep.html)
That web page indicates it's from 2001, but works well enough that
I've never bothered to change it. Not sure how Cygwin grep would act.