]> git.eshelyaron.com Git - emacs.git/commitdiff
(browse-url-file-url): Encode file name on conversion to URL.
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 20 May 2006 04:29:38 +0000 (04:29 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 20 May 2006 04:29:38 +0000 (04:29 +0000)
lisp/net/browse-url.el

index 101b9cf210d73e1b14ff4a39135cfa13a734fdd7..3f514a2aaab9930e13e6f416f393f32b403c113a 100644 (file)
@@ -680,6 +680,10 @@ interactively.  Turn the filename into a URL with function
 (defun browse-url-file-url (file)
   "Return the URL corresponding to FILE.
 Use variable `browse-url-filename-alist' to map filenames to URLs."
+  (let ((coding (and default-enable-multibyte-characters
+                    (or file-name-coding-system
+                        default-file-name-coding-system))))
+    (if coding (setq file (encode-coding-string file coding))))
   ;; URL-encode special chars, do % first
   (let ((s 0))
     (while (setq s (string-match "%" file s))