unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: William Xu <william.xwl@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [william.xwl@gmail.com: webjump-url-encode and non-ascii	characters]
Date: Wed, 25 Jul 2007 09:55:25 +0900	[thread overview]
Message-ID: <E1IDV9x-0008Ky-Ip@etlken.m17n.org> (raw)
In-Reply-To: <87sl7easqc.fsf@www.williamxu.com> (message from William Xu on Tue, 24 Jul 2007 21:31:07 +0900)

In article <87sl7easqc.fsf@www.williamxu.com>, William Xu <william.xwl@gmail.com> writes:

> Kenichi Handa <handa@m17n.org> 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  <william.xwl@gmail.com>  (tiny change)

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

---
Kenichi Handa
handa@m17n.org

> 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
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2007-07-25  0:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1ICpXt-00033U-DV@fencepost.gnu.org>
2007-07-24  1:52 ` [william.xwl@gmail.com: webjump-url-encode and non-ascii characters] Kenichi Handa
2007-07-24  3:36   ` William
2007-07-24  4:16     ` Kenichi Handa
2007-07-24 12:31       ` William Xu
2007-07-25  0:55         ` Kenichi Handa [this message]
2007-07-25  2:35           ` William Xu
2007-07-25  4:30             ` Stefan Monnier
2007-07-25  4:50               ` William Xu
2007-07-25  6:50                 ` Stefan Monnier
2007-07-25  6:57                   ` William Xu
2007-07-25 14:48                     ` Stefan Monnier
2007-07-25 20:11               ` Richard Stallman
2007-07-26  2:22                 ` William Xu
2007-07-24 22:16   ` Richard Stallman
2007-07-25  0:56     ` Kenichi Handa
2007-07-08 22:23 Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1IDV9x-0008Ky-Ip@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=william.xwl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).