1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

(browse-url-file-url): Encode file name on conversion to URL.

This commit is contained in:
YAMAMOTO Mitsuharu 2006-05-20 04:29:38 +00:00
parent f9be433c82
commit 59b715013e

View 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))