From 0a327afe2e416777e09b24c18292f854536bdb23 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Aug 2016 12:44:38 +0300 Subject: [PATCH] Fix the 'T' command in Dired with non_ASCII file names * lisp/dired-aux.el (dired-do-chxxx): Bind coding-system-for-write to correctly encode file names passed to the invoked PROGRAM. (Bug#24162) --- lisp/dired-aux.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4732d9ce85c..83fcf480b74 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -279,6 +279,14 @@ List has a form of (file-name full-file-name (attribute-list))." ((eq op-symbol 'chgrp) (system-groups))))) (operation (concat program " " new-attribute)) + ;; When file-name-coding-system is set to something different + ;; from locale-coding-system, leaving the encoding + ;; determination to call-process will do the wrong thing, + ;; because the arguments in this case are file names, not + ;; just some arbitrary text. (This must be bound last, to + ;; avoid adverse effects on any of the preceding forms.) + (coding-system-for-write (or file-name-coding-system + default-file-name-coding-system)) failures) (setq failures (dired-bunch-files 10000 -- 2.39.2