emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: webjump-url-encode and non-ascii characters]


From: Kenichi Handa
Subject: Re: address@hidden: webjump-url-encode and non-ascii characters]
Date: Wed, 25 Jul 2007 09:55:25 +0900

In article <address@hidden>, William Xu <address@hidden> writes:

> Kenichi Handa <address@hidden> writes:
> > One more note about your change.
> >
> > As mapconcat accepts a sequence (including string),
> > string-to-list is not necessary.

> Correct, thanks ! Here's the updated patch.

Ok, I installed it as a tiny change.  Have you already
signed the assignment paper to FSF?  If so, I'll delete
"(tiny change)" part.

2007-07-25  William Xu  <address@hidden>  (tiny change)

        * net/webjump.el (webjump-url-encode): Fix for non-ASCII
        characters.

---
Kenichi Handa
address@hidden

> cvs diff: Diffing .
> Index: webjump.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/net/webjump.el,v
> retrieving revision 1.4.6.10
> diff -u -r1.4.6.10 webjump.el
> --- webjump.el        30 May 2007 14:40:32 -0000      1.4.6.10
> +++ webjump.el        24 Jul 2007 12:30:46 -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)

> -- 
> William

> 《蜀先主庙》
> 作者:刘禹锡
> 天地英雄气,千秋尚凛然。
> 势分三足鼎,业复五铢钱。
> 得相能开国,生儿不象贤。
> 凄凉蜀故妓,来舞魏宫前。



> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]