dajva / rg.el

Emacs search tool based on ripgrep
https://rgel.readthedocs.io
GNU General Public License v3.0
471 stars 38 forks source link

Chinese character search results not show on rg result buffer #117

Closed maobaoqi closed 3 years ago

maobaoqi commented 3 years ago

Hi,

I use rg.el to search chinese character and the results can not show on rg buffer, but using rg with --encoding=utf-8 on msys2 shell the rg will work well and show many results contains chinese characters

Test on linux, emacs with rg can show chinese character search results. Use command: c\:/msys2/mingw32/bin/rg --color=always --colors=match:fg:red --colors=path:fg:magenta --colors=line:fg:green --colors=column:none -n --column --type-add=gyp\:\*.gyp --type-add=gyp\:\*.gypi -i --heading --no-config --fixed-strings --type=all --encoding utf-8 -e \工\具 .

dajva commented 3 years ago

You can specify your own flags that will always be used by the package: https://rgel.readthedocs.io/en/2.0.3/configuration.html#option-rg-command-line-flags Thers is also an --encoding option in the transient menu. It's not at the default level though so to enable it you need to customize the menu. When the menu is open press C-x l to open the customization mode. There you can change the default level to enable all options at a certain level or move specific options to already enabled level. Everything in green will be on by default.

maobaoqi commented 3 years ago

@dajva This way can not solve the matter. c\:/msys2/mingw32/bin/rg.exe --color=always --colors=match:fg:red --colors=path:fg:magenta --colors=line:fg:green --colors=column:none -n --column --type-add=gyp\:\*.gyp --type-add=gyp\:\*.gypi --encoding=utf-8 -i --heading --no-config --fixed-strings --type=all -e \那\里 .

use the same command in msys2 shell and results can appear.

dajva commented 3 years ago

This works fin for me on linux. Looks like you are on windows so maybe something special is needed there. I can recall a similar problem in another issue that might give you a hint how to solve it: https://github.com/dajva/rg.el/issues/101#issuecomment-713578858

dajva commented 3 years ago

Windows support is not official so closing this.