Fix bug #15337 with non-ASCII characters in file names used by ansi
authorEli Zaretskii <eliz@gnu.org>
Fri, 13 Sep 2013 13:22:47 +0000 (16:22 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 13 Sep 2013 13:22:47 +0000 (16:22 +0300)
 lisp/term.el (term-emulate-terminal): Decode the command string
 before passing it to term-command-hook.

lisp/ChangeLog
lisp/term.el

index 014b487..9315623 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * term.el (term-emulate-terminal): Decode the command string
+       before passing it to term-command-hook.  (Bug#15337)
+
 2013-09-13  Glenn Morris  <rgm@gnu.org>
 
        * eshell/esh-util.el (ange-cache): Move declaration earlier.
index 31889a7..be08029 100644 (file)
@@ -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))))