summaryrefslogtreecommitdiff
path: root/lisp/nxml/rng-uri.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/nxml/rng-uri.el')
-rw-r--r--lisp/nxml/rng-uri.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el
index 0e458cfd2f4..798475bbc3d 100644
--- a/lisp/nxml/rng-uri.el
+++ b/lisp/nxml/rng-uri.el
@@ -30,9 +30,10 @@ Multibyte characters are left as is. Use `rng-uri-escape-multibyte' to
escape them using %HH."
(setq f (expand-file-name f))
(let ((url
- (replace-regexp-in-string "[\000-\032\177<>#%\"{}|\\^[]`%?;]"
- 'rng-percent-encode
- f)))
+ ;; FIXME. Explain why the pattern doesn't also have "!$&'()*+,/:@=".
+ ;; See Internet RFC 3986 section 2.2.
+ (replace-regexp-in-string "[]\0-\s\"#%;<>?[\\^`{|}\177]"
+ 'rng-percent-encode f)))
(concat "file:"
(if (and (> (length url) 0)
(= (aref url 0) ?/))
@@ -42,7 +43,7 @@ escape them using %HH."
(defun rng-uri-escape-multibyte (uri)
"Escape multibyte characters in URI."
- (replace-regexp-in-string "[:nonascii:]"
+ (replace-regexp-in-string "[[:nonascii:]]"
'rng-percent-encode
(encode-coding-string uri 'utf-8)))