# HG changeset patch # User Kenichi Handa # Date 1185324865 0 # Node ID a26a0d557a693ae778e2083ba94b6e2203c50b2a # Parent d8afe3f9ddb7d62803e174ca8bbade7735db2f6a (webjump-url-encode): Fix for non-ASCII characters. diff -r d8afe3f9ddb7 -r a26a0d557a69 lisp/net/webjump.el --- a/lisp/net/webjump.el Tue Jul 24 23:05:44 2007 +0000 +++ b/lisp/net/webjump.el Wed Jul 25 00:54:25 2007 +0000 @@ -451,14 +451,12 @@ (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)