I tried to use rgrep
to search in cyrillic files with UTF-8 encoding (M-x rgrep
command with search query бонус
), the resulting command name was
/usr/bin/find . -type d ( -path */SCCS -o -path */RCS -o -path */CVS -o -path */MCVS -o -path */.src -o -path */.svn -o -path */.git -o -path */.hg -o -path */.bzr -o -path */_MTN -o -path */_darcs -o -path */{arch} ) -prune -o ! -type d ( -name .#* -o -name *.o -o -name *\~ -o -name *.bin -o -name *.lbin -o -name *.so -o -name *.a -o -name *.ln -o -name *.blg -o -name *.bbl -o -name *.elc -o -name *.lof -o -name *.glo -o -name *.idx -o -name *.lot -o -name *.fmt -o -name *.tfm -o -name *.class -o -name *.fas -o -name *.lib -o -name *.mem -o -name *.x86f -o -name *.sparcf -o -name *.dfsl -o -name *.pfsl -o -name *.d64fsl -o -name *.p64fsl -o -name *.lx64fsl -o -name *.lx32fsl -o -name *.dx64fsl -o -name *.dx32fsl -o -name *.fx64fsl -o -name *.fx32fsl -o -name *.sx64fsl -o -name *.sx32fsl -o -name *.wx64fsl -o -name *.wx32fsl -o -name *.fasl -o -name *.ufsl -o -name *.fsl -o -name *.dxl -o -name *.lo -o -name *.la -o -name *.gmo -o -name *.mo -o -name *.toc -o -name *.aux -o -name *.cp -o -name *.fn -o -name *.ky -o -name *.pg -o -name *.tp -o -name *.vr -o -name *.cps -o -name *.fns -o -name *.kys -o -name *.pgs -o -name *.tps -o -name *.vrs -o -name *.pyc -o -name *.pyo ) -prune -o -type f ( -iname *.org ) -exec grep --color -i -nH -e \б\о\н\у\с {} +
As you can see the search term was quoted with slashes \б\о\н\у\с
, and inspite of -i
option to grep
the result was case-sensitive, e.g. lines with бонус
were found, but Бонус
or БОНУС
were not. Of course I can use regexp in search query, but I'd like to avoid this for convenience reason.
How to make such a search really case-insensitive?
I use GNU Emacs 25.3.1 (x86_64-unknown-cygwin) of 2017-09-12
(emacs-w32.exe from cygwin installation) on Windows 7. BTW, the same case-sensitive results I get when use grep -i бонус *.org
in shell under emacs, while in cygwin shell the result is correct.
UPD: Execution of locale
command in emacs shell result in the following:
sh-4.4$ locale
LANG=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=
It seems my locale settings are broken...