]> git.eshelyaron.com Git - emacs.git/commitdiff
(url-retrieve-internal): Hexify multibye URL string first when necessary.
authorWilliam Xu <william.xwl@gmail.com>
Tue, 10 Apr 2012 11:22:08 +0000 (13:22 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Apr 2012 11:22:08 +0000 (13:22 +0200)
Also mention this in the relevant doc strings.

Fixes: debbugs:7017
lisp/url/ChangeLog
lisp/url/url.el

index c2350e56594cb384396c22726d0e9ea8edbe41ea..6dcafb49bd6d05fc30a161afed7ac632666bfe65 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-10  William Xu  <william.xwl@gmail.com>  (tiny change)
+
+       * url.el (url-retrieve-internal): Hexify multibye URL string first
+       when necessary (bug#7017).
+
+2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * url.el (url-retrieve-internal): Mention utf-8 encoding.
+       (url-retrieve): Ditto.
+
 2012-04-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * url-util.el (url-unhex-string): Add an optional CODING-SYSTEM
index 5ced789e4e4450da03f7ec6d04a28308db849c24..f3ef553bbce6e4ddc47eaa60dadd7ed53b0cfd7a 100644 (file)
@@ -149,7 +149,9 @@ take effect.
 
 If SILENT, then don't message progress reports and the like.
 If INHIBIT-COOKIES, cookies will neither be stored nor sent to
-the server."
+the server.
+If URL is a multibyte string, it will be encoded as utf-8 and
+URL-encoded before it's used."
 ;;; XXX: There is code in Emacs that does dynamic binding
 ;;; of the following variables around url-retrieve:
 ;;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets,
@@ -171,11 +173,16 @@ the list of events, as described in the docstring of `url-retrieve'.
 
 If SILENT, don't message progress reports and the like.
 If INHIBIT-COOKIES, cookies will neither be stored nor sent to
-the server."
+the server.
+If URL is a multibyte string, it will be encoded as utf-8 and
+URL-encoded before it's used."
   (url-do-setup)
   (url-gc-dead-buffers)
   (if (stringp url)
        (set-text-properties 0 (length url) nil url))
+  (when (multibyte-string-p url)
+    (let ((url-unreserved-chars (append '(?: ?/) url-unreserved-chars)))
+      (setq url (url-hexify-string url))))
   (if (not (vectorp url))
       (setq url (url-generic-parse-url url)))
   (if (not (functionp callback))