summaryrefslogtreecommitdiff
path: root/lisp/net/webjump.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2007-07-25 00:54:44 +0000
committerKenichi Handa <handa@m17n.org>2007-07-25 00:54:44 +0000
commit80f462b754a32ca4a059919cf2344793ec9eee29 (patch)
treee173ff9da516c6abc7f76c5b455135280b14a0ba /lisp/net/webjump.el
parentd7e69846bb8082943f3aa3cdf76527765240577d (diff)
downloademacs-80f462b754a32ca4a059919cf2344793ec9eee29.tar.gz
(webjump-url-encode): Fix for non-ASCII characters.
Diffstat (limited to 'lisp/net/webjump.el')
-rw-r--r--lisp/net/webjump.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el
index 03ce6305196..0b04c8f2f40 100644
--- a/lisp/net/webjump.el
+++ b/lisp/net/webjump.el
@@ -451,14 +451,12 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
(defun webjump-url-encode (str)
(mapconcat '(lambda (c)
- (cond ((= c 32) "+")
- ((or (and (>= c ?a) (<= c ?z))
- (and (>= c ?A) (<= c ?Z))
- (and (>= c ?0) (<= c ?9)))
- (char-to-string c))
- (t (upcase (format "%%%02x" c)))))
- str
- ""))
+ (let ((s (char-to-string c)))
+ (cond ((string= s " ") "+")
+ ((string-match "[a-zA-Z_.-/]" s) s)
+ (t (upcase (format "%%%02x" c))))))
+ (encode-coding-string str 'utf-8)
+ ""))
(defun webjump-url-fix (url)
(if (webjump-null-or-blank-string-p url)