diff options
| author | William Xu | 2012-04-10 13:22:08 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2012-04-10 13:22:08 +0200 |
| commit | a967e26b4011b7efb9714ef93ec503bc89117194 (patch) | |
| tree | 018d7150433fd985d480b0ada115d9e0a2db9478 | |
| parent | b12f0439bf5ee30d4e19212993fc8d403de8e3ed (diff) | |
| download | emacs-a967e26b4011b7efb9714ef93ec503bc89117194.tar.gz emacs-a967e26b4011b7efb9714ef93ec503bc89117194.zip | |
(url-retrieve-internal): Hexify multibye URL string first when necessary.
Also mention this in the relevant doc strings.
Fixes: debbugs:7017
| -rw-r--r-- | lisp/url/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/url/url.el | 11 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index c2350e56594..6dcafb49bd6 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2012-04-10 William Xu <william.xwl@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * url.el (url-retrieve-internal): Hexify multibye URL string first | ||
| 4 | when necessary (bug#7017). | ||
| 5 | |||
| 6 | 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 7 | |||
| 8 | * url.el (url-retrieve-internal): Mention utf-8 encoding. | ||
| 9 | (url-retrieve): Ditto. | ||
| 10 | |||
| 1 | 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> | 11 | 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 12 | ||
| 3 | * url-util.el (url-unhex-string): Add an optional CODING-SYSTEM | 13 | * url-util.el (url-unhex-string): Add an optional CODING-SYSTEM |
diff --git a/lisp/url/url.el b/lisp/url/url.el index 5ced789e4e4..f3ef553bbce 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el | |||
| @@ -149,7 +149,9 @@ take effect. | |||
| 149 | 149 | ||
| 150 | If SILENT, then don't message progress reports and the like. | 150 | If SILENT, then don't message progress reports and the like. |
| 151 | If INHIBIT-COOKIES, cookies will neither be stored nor sent to | 151 | If INHIBIT-COOKIES, cookies will neither be stored nor sent to |
| 152 | the server." | 152 | the server. |
| 153 | If URL is a multibyte string, it will be encoded as utf-8 and | ||
| 154 | URL-encoded before it's used." | ||
| 153 | ;;; XXX: There is code in Emacs that does dynamic binding | 155 | ;;; XXX: There is code in Emacs that does dynamic binding |
| 154 | ;;; of the following variables around url-retrieve: | 156 | ;;; of the following variables around url-retrieve: |
| 155 | ;;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets, | 157 | ;;; 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'. | |||
| 171 | 173 | ||
| 172 | If SILENT, don't message progress reports and the like. | 174 | If SILENT, don't message progress reports and the like. |
| 173 | If INHIBIT-COOKIES, cookies will neither be stored nor sent to | 175 | If INHIBIT-COOKIES, cookies will neither be stored nor sent to |
| 174 | the server." | 176 | the server. |
| 177 | If URL is a multibyte string, it will be encoded as utf-8 and | ||
| 178 | URL-encoded before it's used." | ||
| 175 | (url-do-setup) | 179 | (url-do-setup) |
| 176 | (url-gc-dead-buffers) | 180 | (url-gc-dead-buffers) |
| 177 | (if (stringp url) | 181 | (if (stringp url) |
| 178 | (set-text-properties 0 (length url) nil url)) | 182 | (set-text-properties 0 (length url) nil url)) |
| 183 | (when (multibyte-string-p url) | ||
| 184 | (let ((url-unreserved-chars (append '(?: ?/) url-unreserved-chars))) | ||
| 185 | (setq url (url-hexify-string url)))) | ||
| 179 | (if (not (vectorp url)) | 186 | (if (not (vectorp url)) |
| 180 | (setq url (url-generic-parse-url url))) | 187 | (setq url (url-generic-parse-url url))) |
| 181 | (if (not (functionp callback)) | 188 | (if (not (functionp callback)) |