summaryrefslogtreecommitdiff
path: root/lisp/dnd.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-12-03 14:21:13 +0200
committerEli Zaretskii <eliz@gnu.org>2013-12-03 14:21:13 +0200
commitd45c90885962da97a8d72d2ffb8ce38046d8cb58 (patch)
tree6eaf922e1456fc625b681df891a9ce627d3f75f6 /lisp/dnd.el
parent051546df1a4e52c44b612853fa14a653bc082860 (diff)
downloademacs-d45c90885962da97a8d72d2ffb8ce38046d8cb58.tar.gz
Fixed drag-n-drop with Unicode file names.
Diffstat (limited to 'lisp/dnd.el')
-rw-r--r--lisp/dnd.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/dnd.el b/lisp/dnd.el
index d9061273c32..a4aa4f4558e 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -152,10 +152,13 @@ Return nil if URI is not a local file."
(let ((f (cond ((string-match "^file:///" uri) ; XDND format.
(substring uri (1- (match-end 0))))
((string-match "^file:" uri) ; Old KDE, Motif, Sun
- (substring uri (match-end 0))))))
- (and f (setq f (decode-coding-string (dnd-unescape-uri f)
- (or file-name-coding-system
- default-file-name-coding-system))))
+ (substring uri (match-end 0)))))
+ (coding (if (equal system-type 'windows-nt)
+ ;; W32 pretends that file names are UTF-8 encoded.
+ 'utf-8
+ (or file-name-coding-system
+ default-file-name-coding-system))))
+ (and f (setq f (decode-coding-string (dnd-unescape-uri f) coding)))
(when (and f must-exist (not (file-readable-p f)))
(setq f nil))
f))