diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-05-20 04:29:38 +0000 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-05-20 04:29:38 +0000 |
commit | 59b715013ed28cc0280fdca151ee750e4f7534c3 (patch) | |
tree | 830716a3095dcba4557aa3a87ff9de48f8f16d06 /lisp/net | |
parent | f9be433c82c1c0bb8903dbd180b599c292557eee (diff) | |
download | emacs-59b715013ed28cc0280fdca151ee750e4f7534c3.tar.gz |
(browse-url-file-url): Encode file name on conversion to URL.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/browse-url.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 101b9cf210d..3f514a2aaab 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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)) |