branch: elpa/helm commit 93a5ebe54904b89c21a639f85c57b679cd4e8499 Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Fix issue #1322 with default-process-coding-system in locate --- helm-locate.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/helm-locate.el b/helm-locate.el index a38e6e1625..222b5e05a0 100644 --- a/helm-locate.el +++ b/helm-locate.el @@ -284,9 +284,23 @@ See also `helm-locate'." 'face 'helm-locate-finish)))) (force-mode-line-update))) +(defun helm-locate--default-process-coding-system () + "Fix `default-process-coding-system' in locate for Windows systems." + ;; This is an attempt to fix issue #1322. + (if (and (eq system-type 'windows-nt) + (boundp 'w32-ansi-code-page)) + (let ((code-page-eol + (intern (format "cp%s-%s" w32-ansi-code-page "dos")))) + (if (ignore-errors (check-coding-system code-page-eol)) + (cons code-page-eol code-page-eol) + default-process-coding-system)) + default-process-coding-system)) + (defun helm-locate-init () "Initialize async locate process for `helm-source-locate'." - (let* ((locate-is-es (string-match "\\`es" helm-locate-command)) + (let* ((default-process-coding-system + (helm-locate--default-process-coding-system)) + (locate-is-es (string-match "\\`es" helm-locate-command)) (real-locate (string-match "\\`locate" helm-locate-command)) (case-sensitive-flag (if locate-is-es "-i" "")) (ignore-case-flag (if (or locate-is-es