]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 1 Jul 2014 14:06:11 +0000 (16:06 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 1 Jul 2014 14:06:11 +0000 (16:06 +0200)
Prefer utf-8 coding.  (Bug#17859)

lisp/ChangeLog
lisp/net/tramp-sh.el

index 0b90c3c98adc2d3194a45332f11d66b5641bb7cb..776925f28b49339bd983376bc235fa24103bd16f 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
+       Prefer utf-8 coding.  (Bug#17859)
+
 2014-06-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * emacs-lisp/subr-x.el (string-reverse): Define as obsolete alias
index 68f1ef472f13b98696f8237098902c5bea9d178c..d906cc67674f0853f4645f51097f98ddd89e92f5 100644 (file)
@@ -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)))