aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-util.el23
2 files changed, 17 insertions, 11 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 901fac01208..e29b4b6b67e 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12006-07-30 Thien-Thi Nguyen <ttn@gnu.org>
2
3 * url-util.el (url-hexify-string): Rewrite.
4 Suggested by David Smith <davidsmith@acm.org>.
5
12006-07-12 Michael Olson <mwolson@gnu.org> 62006-07-12 Michael Olson <mwolson@gnu.org>
2 7
3 * url-irc.el (url-irc-erc): Call erc-handle-irc-url. 8 * url-irc.el (url-irc-erc): Call erc-handle-irc-url.
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index f33a58950fc..4293b0e301f 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -352,17 +352,18 @@ forbidden in URL encoding."
352This is taken from RFC 2396.") 352This is taken from RFC 2396.")
353 353
354;;;###autoload 354;;;###autoload
355(defun url-hexify-string (str) 355(defun url-hexify-string (string)
356 "Escape characters in a string." 356 "Return a new string that is STRING URI-encoded.
357 (mapconcat 357First, STRING is converted to utf-8, if necessary. Then, for each
358 (lambda (char) 358character in the utf-8 string, those found in `url-unreserved-chars'
359 ;; Fixme: use a char table instead. 359are left as-is, all others are represented as a three-character
360 (if (not (memq char url-unreserved-chars)) 360string: \"%\" followed by two lowercase hex digits."
361 (if (> char 255) 361 (mapconcat (lambda (char)
362 (error "Hexifying multibyte character %s" str) 362 (if (memq char url-unreserved-chars)
363 (format "%%%02X" char)) 363 (char-to-string char)
364 (char-to-string char))) 364 (format "%%%02x" char)))
365 str "")) 365 (encode-coding-string string 'utf-8 t)
366 ""))
366 367
367;;;###autoload 368;;;###autoload
368(defun url-file-extension (fname &optional x) 369(defun url-file-extension (fname &optional x)