[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: |
Drew Adams |
Subject: |
RE: `grep' command on MS Windows with Cygwin, looking for text with Unicode chars |
Date: |
Wed, 13 Jun 2018 12:26:27 -0700 (PDT) |
> >> 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
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.interlog.com_-
> 7Etcharron_grep.html&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_J
> nE&r=kI3P6ljGv6CTHIKju0jqInF6AOwMCYRDQUmqX22rJ98&m=mwTRqK15rRKM1JijTtXJcy
> fypP_2OPkAexmNd725LFQ&s=ElcYIkHLVnToY1wdciKB3H6WEeO6g1KYRX-M4tBIsro&e=)
>
> 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.
Interesting; thanks.
With my (old) Cygwin grep, in the `lisp' directory, that shows 4 hits,
3 in char-fold.el and one in mpc.el. The first char-fold.el hit shows
matches for curly quotes, for example. But I guess that won't help me
find just curly quotes. ;-)
In each case, the grep hits show octal escapes instead of Unicode-char glyphs.