From: Michael Albinus Date: Tue, 1 Jul 2014 14:06:11 +0000 (+0200) Subject: * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): X-Git-Tag: emacs-25.0.90~2636^2~73^2~21 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=005f996739e9b59e01b3c10f153efb4c4e54353d;p=emacs.git * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Prefer utf-8 coding. (Bug#17859) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b90c3c98ad..776925f28b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-01 Michael Albinus + + * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): + Prefer utf-8 coding. (Bug#17859) + 2014-06-30 Fabián Ezequiel Gallina * emacs-lisp/subr-x.el (string-reverse): Define as obsolete alias diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 68f1ef472f1..d906cc67674 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3964,15 +3964,16 @@ process to set up. VEC specifies the connection." ;; Try to set up the coding system correctly. ;; CCC this can't be the right way to do it. Hm. (tramp-message vec 5 "Determining coding system") - (tramp-send-command vec "echo foo ; echo bar" t) (with-current-buffer (process-buffer proc) - (goto-char (point-min)) (if (featurep 'mule) ;; Use MULE to select the right EOL convention for communicating ;; with the process. - (let* ((cs (or (tramp-compat-funcall 'process-coding-system proc) - (cons 'undecided 'undecided))) - cs-decode cs-encode) + (let ((cs (or (when (string-match + "utf8" (or (tramp-get-remote-locale vec) "")) + (cons 'utf-8 'utf-8)) + (tramp-compat-funcall 'process-coding-system proc) + (cons 'undecided 'undecided))) + cs-decode cs-encode) (when (symbolp cs) (setq cs (cons cs cs))) (setq cs-decode (car cs)) (setq cs-encode (cdr cs)) @@ -3980,6 +3981,8 @@ process to set up. VEC specifies the connection." (unless cs-encode (setq cs-encode 'undecided)) (setq cs-encode (tramp-compat-coding-system-change-eol-conversion cs-encode 'unix)) + (tramp-send-command vec "echo foo ; echo bar" t) + (goto-char (point-min)) (when (search-forward "\r" nil t) (setq cs-decode (tramp-compat-coding-system-change-eol-conversion cs-decode 'dos)))