(browse-url-file-url): Encode file name on conversion to URL.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user