branch: elpa/helm commit ef4e7b96ce6ea12d3728ac6a0fcb349fc42e2ce9 Author: zbelial <zjyzhaojiy...@gmail.com> Commit: Thierry Volpiatto <thie...@posteo.net>
encode helm-pattern and directory to make helm-grep-ag work with non-utf8 chars --- helm-grep.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helm-grep.el b/helm-grep.el index 0c5342cb71..41cb8016b0 100644 --- a/helm-grep.el +++ b/helm-grep.el @@ -1635,8 +1635,12 @@ returns if available with current AG version." (helm-default-directory) default-directory)) (cmd-line (helm-grep-ag-prepare-cmd-line - helm-pattern (or (file-remote-p directory 'localname) - directory) + ;; NOTE Encode directory name and pattern, + ;; or it may not work with Chinese and maybe other non-utf8 + ;; characters on MSWindows systems issue#2677 and issue#2678. + (encode-coding-string helm-pattern locale-coding-system) + (or (file-remote-p directory 'localname) + (encode-coding-string directory locale-coding-system)) type)) (start-time (float-time)) (proc-name (helm-grep--ag-command)))