From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69876 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: one rfc2047-encode error halts entire gnus-group-get-new-news run Date: Fri, 06 Aug 2010 12:44:37 +0900 Organization: Emacsen advocacy group Message-ID: References: <874of8646r.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1281066378 22680 80.91.229.12 (6 Aug 2010 03:46:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 03:46:18 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M18263@lists.math.uh.edu Fri Aug 06 05:46:15 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OhDsr-0006Mq-GT for ding-account@gmane.org; Fri, 06 Aug 2010 05:46:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1OhDsL-00024T-29; Thu, 05 Aug 2010 22:45:41 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1OhDsJ-00024F-RT for ding@lists.math.uh.edu; Thu, 05 Aug 2010 22:45:39 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OhDs9-00073t-0v for ding@lists.math.uh.edu; Thu, 05 Aug 2010 22:45:39 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OhDs8-0006cy-00 for ; Fri, 06 Aug 2010 05:45:28 +0200 Original-Received: from localhost ([127.0.0.1]:37096) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1OhDrX-0006KH-DI for ding@gnus.org; Thu, 05 Aug 2010 22:44:51 -0500 X-Hashcash: 1:20:100806:ding@gnus.org::JltKOiU74jw1Og78:00001tTD X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:LNc3N6/pOFKVjQoyDX8PHLjix8o= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69876 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable jidanni@jidanni.org wrote: > My entire > g runs the command gnus-group-get-new-news > run was halted midway upon reaching > http://radioscanningtw.wikia.com/index.php?title=3D%E7%89%B9%E6%AE%8A:%E6= %9C%80%E8%BF%91%E6%9B%B4%E6%94%B9&feed=3Drss > nnrss: Requesting WIKIA Taiwan Radio Scanning Wiki - =E8=BF=91=E6=9C=9F= =E8=AE=8A=E5=8B=95 [zh-tw]... > rfc2047-encode: Can't rfc2047-encode `=E4=BD=BF=E7=94=A8=E8=80=85:=C6=96\= 271=E5=AF=8C=E8=A3=95' > Why should one little error bring the entire gnus-group-get-new-news run > to a halt? > nnrss-version "nnrss 1.0" That can happen when not only running `gnus-group-get-new-news' in a nnrss group if there are funny characters in text to be MIME encoded. `rfc2047-encode' uses `mm-find-mime-charset-region' to determine charset that is used to encode text, and expects that it returns a list of single valid charset. However, as the case may be, it may return a list containing an invalid charset (actually `nil') or just a list containing a single `nil'. (with-temp-buffer (insert "=E4=BD=BF=E7=94=A8=E8=80=85:=C6=96\271=E5=AF=8C=E8=A3=95") (mm-find-mime-charset-region (point-min) (point-max))) =3D> (nil iso-2022-jp) (The result will vary according to the language environment.) In the most case it returns `utf-8' nowadays, but the `nil' element in the result means there is a character that cannot be encoded by any charset. For such a case, I've modified `rfc2047-encode' so as to use `utf-8' as a last resort (the diff follows). It is no more than a workaround, i.e. some characters may be encoded irreversibly, but cannot help it. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- rfc2047.el~ 2010-05-25 07:23:25 +0000 +++ rfc2047.el 2010-08-06 03:36:22 +0000 @@ -655,6 +655,9 @@ Point moves to the end of the region." (let ((mime-charset (or (mm-find-mime-charset-region b e) (list 'us-ascii))) cs encoding tail crest eword) + ;; Use utf-8 as a last resort if determining charset of text fails. + (if (memq nil mime-charset) + (setq mime-charset (list 'utf-8))) (cond ((> (length mime-charset) 1) (error "Can't rfc2047-encode `%s'" (buffer-substring-no-properties b e))) --=-=-=--