Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: jidanni@jidanni.org
Cc: ding@gnus.org
Subject: Re: Character of Death locks one out of all newsgroups
Date: Mon, 05 Jan 2009 13:18:34 +0900	[thread overview]
Message-ID: <b4miqou5qsl.fsf@jpl.org> (raw)
In-Reply-To: <87bpuytys2.fsf@jidanni.org>

>>>>> jidanni@jidanni.org wrote:

> One bad character locks me out of all newsgroups... until when, one
> doesn't know. Great denial of service attack.

> Debugger entered--Lisp error: (error "Can't rfc2047-encode `\x2563d\x2587c \x256cf\x7ecf'")
>   signal(error ("Can't rfc2047-encode `\x2563d\x2587c \x256cf\x7ecf'"))
>   error("Can't rfc2047-encode `%s'" "\x2563d\x2587c \x256cf\x7ecf")
>   rfc2047-encode(5 10)
>   rfc2047-encode-region(1 12)
>   nnrss-mime-encode-string("Re: \x2563d\x2587c&#20146;\x256cf&#32463;&#21382; 3")
>   nnrss-check-group("BDSM \x25322\x25cf0\x25d37\x268a2" "")
>   nnrss-request-group("BDSM 一般討論" "" nil)
>   gnus-activate-group("nnrss:BDSM 一般討論" scan)
>   gnus-get-unread-articles(nil)
>   gnus-group-get-new-news()

I discovered this is due to the `mm-url-decode-entities' function
that uses `char-to-string' to convert entities to human-readable
characters.  When decoding the entity "&#32463;", it runs:

(char-to-string 32463)

That's ok in Emacs 23, however to make it work also with Emacs 22
it should be:

(char-to-string (decode-char 'ucs 32463))

Because of this, funny characters are passed to the rfc2047 encoder
in Emacs 22.

For XEmacs with mule, we will have to do like emacs-w3m does, but
there seems to be no way to make it work with Emacs 21.  Anyway we
will need time to fix this problem (see `w3m-ucs-to-char' provided
in w3m-ems.el and w3m-xmas.el and `w3m-decode-entities' in w3m.el.)

A workaround:
--8<---------------cut here---------------start------------->8---
(eval-after-load "mm-url"
  '(progn
     (require 'w3m)
     (defalias 'mm-url-decode-entities `w3m-decode-entities)))
--8<---------------cut here---------------end--------------->8---

I verified it works with Emacs 22.1, 22.2, 22.3, XEmacs 21.4.22,
21.5-b28, and SXEmacs 22.1.10 as follows:

(rfc2047-decode-string
 (nnrss-mime-encode-string "Re: 我的&#20146;身&#32463;&#21382; 3"))
 => "Re: 我的亲身经历 3"

Regards,



  parent reply	other threads:[~2009-01-05  4:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-26 21:25 jidanni
2008-12-29 22:05 ` jidanni
2009-01-01 19:57 ` Reiner Steib
2009-01-02 21:11   ` jidanni
2009-01-05  4:18 ` Katsumi Yamaoka [this message]
2009-01-05  8:00   ` Katsumi Yamaoka
2009-01-05 17:48     ` jidanni
2009-01-05 22:10       ` Katsumi Yamaoka

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

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

  git send-email \
    --in-reply-to=b4miqou5qsl.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=jidanni@jidanni.org \
    /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.
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 NNTP newsgroup(s).