Mercurial > emacs
changeset 70762:65f2c33d043f
(browse-url-file-url): Encode file name on conversion to URL.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Sat, 20 May 2006 04:29:38 +0000 |
parents | b1742b0066f2 |
children | e5e83c1c6fa5 |
files | lisp/net/browse-url.el |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/net/browse-url.el Sat May 20 04:29:18 2006 +0000 +++ b/lisp/net/browse-url.el Sat May 20 04:29:38 2006 +0000 @@ -680,6 +680,10 @@ (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))