aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-05-09 20:20:26 +0800
committerChong Yidong2012-05-09 20:20:26 +0800
commitbdac2d37fa5f83ec57d794523147dc5d5a179992 (patch)
tree79426859145b5adfc0455bca60dec56c6584fee1
parentce7b18ec41c5102f4af27ec22cf873a75f510630 (diff)
downloademacs-bdac2d37fa5f83ec57d794523147dc5d5a179992.tar.gz
emacs-bdac2d37fa5f83ec57d794523147dc5d5a179992.zip
* url-util.el (url--allowed-chars): Use upper-case for percent-encoding.
-rw-r--r--lisp/url/ChangeLog2
-rw-r--r--lisp/url/url-util.el7
2 files changed, 6 insertions, 3 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 3980b22d4c1..b3669a72ac3 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -3,7 +3,7 @@
3 * url-util.el (url-encode-url): New function for URL quoting. 3 * url-util.el (url-encode-url): New function for URL quoting.
4 (url-encoding-table, url-host-allowed-chars) 4 (url-encoding-table, url-host-allowed-chars)
5 (url-path-allowed-chars): New constants. 5 (url-path-allowed-chars): New constants.
6 (url--allowed-chars): New helper function. 6 (url--allowed-chars): New helper function. Use upper-case.
7 (url-hexify-string): Use them. 7 (url-hexify-string): Use them.
8 8
9 * url-parse.el: Improve RFC 3986 conformance. 9 * url-parse.el: Improve RFC 3986 conformance.
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index c8016ef6cdb..4185c87918e 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -343,7 +343,10 @@ This is taken from RFC 3986 (section 2.3).")
343(defconst url-encoding-table 343(defconst url-encoding-table
344 (let ((vec (make-vector 256 nil))) 344 (let ((vec (make-vector 256 nil)))
345 (dotimes (byte 256) 345 (dotimes (byte 256)
346 (aset vec byte (format "%%%02x" byte))) 346 ;; RFC 3986 (Section 2.1): For consistency, URI producers and
347 ;; normalizers should use uppercase hexadecimal digits for all
348 ;; percent-encodings.
349 (aset vec byte (format "%%%02X" byte)))
347 vec) 350 vec)
348 "Vector translating bytes to URI-encoded %-sequences.") 351 "Vector translating bytes to URI-encoded %-sequences.")
349 352
@@ -362,7 +365,7 @@ result can be passed as the second arg to `url-hexify-string'."
362If STRING is multibyte, it is first converted to a utf-8 byte 365If STRING is multibyte, it is first converted to a utf-8 byte
363string. Each byte corresponding to an allowed character is left 366string. Each byte corresponding to an allowed character is left
364as-is, while all other bytes are converted to a three-character 367as-is, while all other bytes are converted to a three-character
365string: \"%\" followed by two lowercase hex digits. 368string: \"%\" followed by two upper-case hex digits.
366 369
367The allowed characters are specified by ALLOWED-CHARS. If this 370The allowed characters are specified by ALLOWED-CHARS. If this
368argument is nil, the list `url-unreserved-chars' determines the 371argument is nil, the list `url-unreserved-chars' determines the