From 59b715013ed28cc0280fdca151ee750e4f7534c3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 20 May 2006 04:29:38 +0000 Subject: [PATCH] (browse-url-file-url): Encode file name on conversion to URL. --- lisp/net/browse-url.el | 4 ++++ 1 file changed, 4 insertions(+) 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)) -- 2.39.2