changeset 50197:ecb46e1986f0

* dired.el (dired-get-filename): Pay attention to the case that `read' returns a unibyte string. Don't encode the file name by buffer-file-coding-system.
author Kenichi Handa <handa@m17n.org>
date Wed, 19 Mar 2003 11:58:25 +0000
parents 320721ae5978
children e3786189489e
files lisp/dired.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Wed Mar 19 11:54:57 2003 +0000
+++ b/lisp/dired.el	Wed Mar 19 11:58:25 2003 +0000
@@ -1462,16 +1462,17 @@
 			 (or (dired-string-replace-match
 			      "\\([^\\]\\|\\`\\)\"" file "\\1\\\\\"" nil t)
 			     file)
-			 "\"")))))
+			 "\"")))
+	  ;; The above `read' will return a unibyte string if FILE
+	  ;; contains eight-bit-control/graphic characters.
+	  (if (and enable-multibyte-characters
+		   (not (multibyte-string-p file)))
+	      (setq file (string-to-multibyte file)))))
     (and file (file-name-absolute-p file)
 	 ;; A relative file name can start with ~.
 	 ;; Don't treat it as absolute in this context.
 	 (not (eq (aref file 0) ?~))
 	 (setq already-absolute t))
-    (and file buffer-file-coding-system
-	 (not file-name-coding-system)
-	 (not default-file-name-coding-system)
-	 (setq file (encode-coding-string file buffer-file-coding-system)))
     (cond
      ((null file)
       nil)