From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65781 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: More liberal MIME decoding (unencoded question marks in encoded words) Date: Mon, 26 Nov 2007 21:31:46 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1196080344 14075 80.91.229.12 (26 Nov 2007 12:32:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2007 12:32:24 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14277@lists.math.uh.edu Mon Nov 26 13:32:32 2007 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.50) id 1Iwd8V-0001YB-Gr for ding-account@gmane.org; Mon, 26 Nov 2007 13:32:27 +0100 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 1Iwd7h-00089s-TW; Mon, 26 Nov 2007 06:31:37 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Iwd7f-00089Y-UU for ding@lists.math.uh.edu; Mon, 26 Nov 2007 06:31:35 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Iwd7Y-0008Lv-Pt for ding@lists.math.uh.edu; Mon, 26 Nov 2007 06:31:35 -0600 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Iwd7V-0002v7-00 for ; Mon, 26 Nov 2007 13:31:25 +0100 Original-Received: from [66.225.201.151] (port=42942 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1Iwd81-0004A0-3W for ding@gnus.org; Mon, 26 Nov 2007 06:31:57 -0600 X-Hashcash: 1:20:071126:ding@gnus.org::2HqCImKQxnCQG4O6:00001BGy 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.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:48e4dd8YETjmsPoM3Qq8x6pOhuk= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus 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: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65781 Archived-At: --=-=-= >>>>> Reiner Steib wrote: > I see more an more incorrectly encoded subjects like this: > ,---- >| Subject: =?ISO-8859-1?Q?bequeme_Index-Eintr=E4ge_mit_TexnicCenter??= >| Organization: http://groups.google.com >| Message-ID: <78a8858d-463a-4a24-b18c-d0579ef60be9@s19g2000prg.googlegroups.com> >| User-Agent: G2/1.0 > `---- > The mistake on Google's side is not to encode the (trailing) question > mark. How can we make Gnus' decoder more liberal? Maybe the patch below does it but we must check it thoroughly. Would we be able to make complete test cases? (rfc2047-decode-string "=?ISO-8859-1?Q??foo?=") "?foo" (rfc2047-decode-string "=?ISO-8859-1?Q?=foo?=") "=foo" (rfc2047-decode-string "=?ISO-8859-1?Q?foo??=") "foo?" (rfc2047-decode-string "=?ISO-8859-1?Q?foo?=?=") "foo?=" (rfc2047-decode-string "=?ISO-8859-1?Q?foo?==?ISO-8859-1?Q?bar?=") "foobar" ... --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- rfc2047.el~ 2007-10-04 21:53:36 +0000 +++ rfc2047.el 2007-11-26 12:25:07 +0000 @@ -827,8 +827,10 @@ (eval-and-compile (defconst rfc2047-encoded-word-regexp - "=\\?\\([^][\000-\040()<>@,\;:*\\\"/?.=]+\\)\\(?:\\*[^?]+\\)?\ -\\?\\(B\\|Q\\)\\?\\([!->@-~ ]*\\)\\?=")) + "=\\?\\([^][\000-\040()<>@,\;:*\\\"/?.=]+\\)\\(?:\\*[^?]+\\)?\\?\ +\\(B\\?[+/0-9A-Za-z]*=*\ +\\|Q\\?\\(?:\\?+[ -<>@-~]\\)?\\(?:[ ->@-~]+\\?+[ -<>@-~]\\)*[ ->@-~]*\\?*\ +\\)\\?=")) (defvar rfc2047-quote-decoded-words-containing-tspecials nil "If non-nil, quote decoded words containing special characters.") @@ -967,7 +969,7 @@ (while match (push (list (match-string 2) ;; charset (char-after (match-beginning 3)) ;; encoding - (match-string 4) ;; encoded-text + (substring (match-string 3) 2) ;; encoded-text (match-string 1)) ;; encoded-word words) ;; Look for the subsequent encoded-words. --=-=-=--