aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2012-04-10 04:14:13 +0200
committerLars Magne Ingebrigtsen2012-04-10 04:14:13 +0200
commit4bbc3323df984f9614960a066d99460be4a65b4a (patch)
tree8c6082f64f8e151afb5b480cb5a858f769ad0b9c
parent24d78a88add65761b0d0f63777e76fca6f2d66f8 (diff)
downloademacs-4bbc3323df984f9614960a066d99460be4a65b4a.tar.gz
emacs-4bbc3323df984f9614960a066d99460be4a65b4a.zip
(url-unhex-string): Add an optional CODING-SYSTEM parameter.
Fixes: debbugs:6252
-rw-r--r--lisp/url/ChangeLog3
-rw-r--r--lisp/url/url-util.el10
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 4c9635f8ecf..c2350e56594 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,5 +1,8 @@
12012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> 12012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * url-util.el (url-unhex-string): Add an optional CODING-SYSTEM
4 parameter (bug#6252).
5
3 * url-domsurf.el: New file (bug#1401). 6 * url-domsurf.el: New file (bug#1401).
4 7
5 * url-cookie.el (url-cookie-two-dot-domains): Remove. 8 * url-cookie.el (url-cookie-two-dot-domains): Remove.
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 848eb66e54b..c62b820c2e7 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -308,11 +308,13 @@ Will not do anything if `url-show-status' is nil."
308;; str)) 308;; str))
309 309
310;;;###autoload 310;;;###autoload
311(defun url-unhex-string (str &optional allow-newlines) 311(defun url-unhex-string (str &optional allow-newlines coding-system)
312 "Remove %XX embedded spaces, etc in a URL. 312 "Remove %XX embedded spaces, etc in a URL.
313If optional second argument ALLOW-NEWLINES is non-nil, then allow the 313If optional second argument ALLOW-NEWLINES is non-nil, then allow the
314decoding of carriage returns and line feeds in the string, which is normally 314decoding of carriage returns and line feeds in the string, which is normally
315forbidden in URL encoding." 315forbidden in URL encoding.
316If CODING-SYSTEM is non-nil, interpret the unhexed string as
317being encoded in that coding system."
316 (setq str (or str "")) 318 (setq str (or str ""))
317 (let ((tmp "") 319 (let ((tmp "")
318 (case-fold-search t)) 320 (case-fold-search t))
@@ -331,7 +333,9 @@ forbidden in URL encoding."
331 (t (byte-to-string code)))) 333 (t (byte-to-string code))))
332 str (substring str (match-end 0))))) 334 str (substring str (match-end 0)))))
333 (setq tmp (concat tmp str)) 335 (setq tmp (concat tmp str))
334 tmp)) 336 (if coding-system
337 (decode-coding-string tmp coding-system)
338 tmp)))
335 339
336(defconst url-unreserved-chars 340(defconst url-unreserved-chars
337 '( 341 '(