counsel-rg在win10中搜索中文的问题

;; win32平台解决rg.el无法正常搜索中文,在调用rg.exe前使用本地编码修改pattern 
(advice-add 'rg-run :around  
            (lambda (orig-fun &rest args)  
              (let ((pattern (car args)))  
                (apply orig-fun  
                       (encode-coding-string pattern locale-coding-system)  
                       (cdr args)))))
1 个赞