emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117457: * net/tramp-sh.el (tramp-open-connection-se


From: Michael Albinus
Subject: [Emacs-diffs] trunk r117457: * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Date: Tue, 01 Jul 2014 14:06:18 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117457
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Tue 2014-07-01 16:06:11 +0200
message:
  * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
  Prefer utf-8 coding.  (Bug#17859)
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-30 20:17:17 +0000
+++ b/lisp/ChangeLog    2014-07-01 14:06:11 +0000
@@ -1,3 +1,8 @@
+2014-07-01  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
+       Prefer utf-8 coding.  (Bug#17859)
+
 2014-06-30  Fabián Ezequiel Gallina  <address@hidden>
 
        * emacs-lisp/subr-x.el (string-reverse): Define as obsolete alias

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-06-24 07:15:26 +0000
+++ b/lisp/net/tramp-sh.el      2014-07-01 14:06:11 +0000
@@ -3964,15 +3964,16 @@
   ;; 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 @@
          (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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]