emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108173: * url-util.el (url--allowed-


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108173: * url-util.el (url--allowed-chars): Use upper-case for percent-encoding.
Date: Wed, 09 May 2012 20:20:26 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 108173
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-05-09 20:20:26 +0800
message:
  * url-util.el (url--allowed-chars): Use upper-case for percent-encoding.
modified:
  lisp/url/ChangeLog
  lisp/url/url-util.el
=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2012-05-09 08:33:48 +0000
+++ b/lisp/url/ChangeLog        2012-05-09 12:20:26 +0000
@@ -3,7 +3,7 @@
        * url-util.el (url-encode-url): New function for URL quoting.
        (url-encoding-table, url-host-allowed-chars)
        (url-path-allowed-chars): New constants.
-       (url--allowed-chars): New helper function.
+       (url--allowed-chars): New helper function.  Use upper-case.
        (url-hexify-string): Use them.
 
        * url-parse.el: Improve RFC 3986 conformance.

=== modified file 'lisp/url/url-util.el'
--- a/lisp/url/url-util.el      2012-05-09 08:33:48 +0000
+++ b/lisp/url/url-util.el      2012-05-09 12:20:26 +0000
@@ -343,7 +343,10 @@
 (defconst url-encoding-table
   (let ((vec (make-vector 256 nil)))
     (dotimes (byte 256)
-      (aset vec byte (format "%%%02x" byte)))
+      ;; RFC 3986 (Section 2.1): For consistency, URI producers and
+      ;; normalizers should use uppercase hexadecimal digits for all
+      ;; percent-encodings.
+      (aset vec byte (format "%%%02X" byte)))
     vec)
   "Vector translating bytes to URI-encoded %-sequences.")
 
@@ -362,7 +365,7 @@
 If STRING is multibyte, it is first converted to a utf-8 byte
 string.  Each byte corresponding to an allowed character is left
 as-is, while all other bytes are converted to a three-character
-string: \"%\" followed by two lowercase hex digits.
+string: \"%\" followed by two upper-case hex digits.
 
 The allowed characters are specified by ALLOWED-CHARS.  If this
 argument is nil, the list `url-unreserved-chars' determines the


reply via email to

[Prev in Thread] Current Thread [Next in Thread]