Sorry for the late response. In article , Richard Stallman writes: > [I sent this message a weeks ago but did not get a response. > Is this in your area? I would expect it is, since it deals > with non-ASCII characters, but maybe it isn't. If it isn't, > please say so. > Please respond!] > Is this patch correct? Most particularly, is it correct to use > buffer-file-coding-system for a URL? I have doubts about that. I doubts too. I'm not the expert of URL (or URI) encoding, but, as far as I remember, non-ASCII characters in URL must be at first encoded by UTF-8 then by %-encoding. So, for instance, $(D+"(B (U+00E0) must be encoded to "%C3%80". --- Kenichi Handa handa@m17n.org > ------- Start of forwarded message ------- > X-Spam-Status: No, score=1.3 required=5.0 tests=RCVD_NUMERIC_HELO, > SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no version=3.1.0 > To: emacs-devel@gnu.org > From: William Xu > Date: Wed, 04 Jul 2007 18:34:51 +0800 > Organization: the Church of Emacs > Mime-Version: 1.0 > Content-Type: text/plain; charset=utf-8 > Subject: webjump-url-encode and non-ascii characters > webjump-url-encode fails to encode non-ascii characters correctly. > Here's a patch: > - --- webjump.el 2007-06-03 14:54:53.000000000 +0800 > +++ webjump.el.new 2007-07-04 18:29:41.000000000 +0800 > @@ -451,14 +451,13 @@ > (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)))))) > + (string-to-list > + (encode-coding-string str buffer-file-coding-system)) > + "")) > (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 > ------- End of forwarded message -------