From: Kenichi Handa Date: Wed, 25 Jul 2007 00:54:44 +0000 (+0000) Subject: (webjump-url-encode): Fix for non-ASCII characters. X-Git-Tag: emacs-pretest-23.0.90~11734 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=80f462b754a32ca4a059919cf2344793ec9eee29;p=emacs.git (webjump-url-encode): Fix for non-ASCII characters. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e30db6c7029..15732e651c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-07-25 William Xu (tiny change) + + * net/webjump.el (webjump-url-encode): Fix for non-ASCII + characters. + 2007-07-24 Dan Nicolaescu * dired.el (dired-mode-map): Bind wdired-change-to-wdired-mode to 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)