From 84387cd2595e0e99bb6976fe1e160156b5291611 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 13 Sep 2013 16:22:47 +0300 Subject: [PATCH] Fix bug #15337 with non-ASCII characters in file names used by ansi lisp/term.el (term-emulate-terminal): Decode the command string before passing it to term-command-hook. --- lisp/ChangeLog | 5 +++++ lisp/term.el | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 014b48771c..93156233ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-09-13 Eli Zaretskii + + * term.el (term-emulate-terminal): Decode the command string + before passing it to term-command-hook. (Bug#15337) + 2013-09-13 Glenn Morris * eshell/esh-util.el (ange-cache): Move declaration earlier. diff --git a/lisp/term.el b/lisp/term.el index 31889a7827..be080297b2 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2937,8 +2937,10 @@ See `term-prompt-regexp'." (let ((end (string-match "\r?$" str i))) (if end (funcall term-command-hook - (prog1 (substring str (1+ i) end) - (setq i (match-end 0)))) + (decode-coding-string + (prog1 (substring str (1+ i) end) + (setq i (match-end 0))) + locale-coding-system)) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) -- 2.20.1