diff options
| author | YAMAMOTO Mitsuharu | 2006-05-20 04:29:38 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-05-20 04:29:38 +0000 |
| commit | 59b715013ed28cc0280fdca151ee750e4f7534c3 (patch) | |
| tree | 830716a3095dcba4557aa3a87ff9de48f8f16d06 | |
| parent | f9be433c82c1c0bb8903dbd180b599c292557eee (diff) | |
| download | emacs-59b715013ed28cc0280fdca151ee750e4f7534c3.tar.gz emacs-59b715013ed28cc0280fdca151ee750e4f7534c3.zip | |
(browse-url-file-url): Encode file name on conversion to URL.
| -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 | |||
| 680 | (defun browse-url-file-url (file) | 680 | (defun browse-url-file-url (file) |
| 681 | "Return the URL corresponding to FILE. | 681 | "Return the URL corresponding to FILE. |
| 682 | Use variable `browse-url-filename-alist' to map filenames to URLs." | 682 | Use variable `browse-url-filename-alist' to map filenames to URLs." |
| 683 | (let ((coding (and default-enable-multibyte-characters | ||
| 684 | (or file-name-coding-system | ||
| 685 | default-file-name-coding-system)))) | ||
| 686 | (if coding (setq file (encode-coding-string file coding)))) | ||
| 683 | ;; URL-encode special chars, do % first | 687 | ;; URL-encode special chars, do % first |
| 684 | (let ((s 0)) | 688 | (let ((s 0)) |
| 685 | (while (setq s (string-match "%" file s)) | 689 | (while (setq s (string-match "%" file s)) |