From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59798 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Reply misinterprets Commas in encoded-words (Gnus violates RFC 2047) Date: Mon, 14 Feb 2005 16:16:10 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1108498575 27499 80.91.229.2 (15 Feb 2005 20:16:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Feb 2005 20:16:15 +0000 (UTC) Cc: =?iso-8859-1?Q?=22Wiens=2C_Stef=AAn=22?= Original-X-From: ding-owner+M8345@lists.math.uh.edu Tue Feb 15 21:16:14 2005 Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D196M-0005p3-0M for ding-account@gmane.org; Tue, 15 Feb 2005 21:15:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1D1956-0000o5-00; Tue, 15 Feb 2005 14:14:00 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1D18xb-0000MB-06 for ding@lists.math.uh.edu; Tue, 15 Feb 2005 14:06:15 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1D0aT4-0002L6-LV for ding@lists.math.uh.edu; Mon, 14 Feb 2005 01:16:26 -0600 Original-Received: from washington.hostforweb.net ([69.61.11.2]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1D0aT3-0004gT-00 for ; Mon, 14 Feb 2005 08:16:25 +0100 Original-Received: from localhost ([127.0.0.1]) by washington.hostforweb.net with esmtpa (Exim 4.44) id 1D0aT3-0000Fs-Ej; Mon, 14 Feb 2005 02:16:25 -0500 Original-To: ding@gnus.org 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.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:kyv3CpisS5J+jrBouWxafwlCv8w= X-Hashcash: 1:20:050214:ding@gnus.org::q71gOedRLLGINFZU:00002Pag X-Hashcash: 1:20:050214:s.wi@gmx.net::oFgYlZb1I5vY4Xm4:000008kOS 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 - washington.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: -4.8 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu X-MailScanner-From: ding-owner+m8345@lists.math.uh.edu X-MailScanner-To: ding-account@gmane.org Xref: main.gmane.org gmane.emacs.gnus.general:59798 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59798 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >>>>> In Reiner Steib wrote: > Hi, > back in September 2004, Stefan Wiens reported the following bug in > gnus.gnus-bug but there was no response or fix yet: > ,---- >| From: =3D?iso-8859-1?q?Wiens=3D2C_Stef=3DAAn?=3D >| Subject: Reply misinterprets Commas in encoded-words >| Newsgroups: gnus.gnus-bug >| Date: Sat, 18 Sep 2004 03:34:06 +0200 >| Message-ID: <87pt4kbbsh.fsf@xenon.eswe.dyndns.org> >|=20 >| To reproduce, please try to "reply" or "wide reply" to this message >| and have a look at the "To" and "Cc" headers in your Message buffer. > `---- > The problem is that Gnus decodes =BB=3D?iso-8859-1?q?Wiens=3D2C_Stef=3DAA= n?=3D=AB > to =BBWiens, Stef=AAn =AB in the article buffer and when do= ing > a (wide) reply, this leads to: >| To: Wiens >| Cc: Stef=AAn , bugs@gnus.org > Note that this problem is not artifical (as the =BB=AA=AB might suggest): > Many people in Germany or other countries have non-ascii in their > names. If the mail software of the sender writes the full name in the > From/Cc header in the form =BBLastname, F=EDrstname=AB the user cannot re= ply > correctly without manual correction. > In the German Gnus newsgroup this has been discussed several times: > (a) http://www.google.de/groups?as_umsgid=3Duoek8x11f.fsf@M.web.de&hl=3Den > (b) http://www.google.de/groups?as_umsgid=3D87brbdhc4d.fsf@ABG3595C.abg.f= sc.net&hl=3Den Though I cannot read German articles, I may be able somewhat to help. > According to Stefan Wiens and Dirk Nimmich (tin developer), Gnus' > behavior violates RFC 2047 (see thread (a)). Could somebody look at > this problem, please? Stefan, maybe you could summarize this and the > other problems with Gnus RFC-2047 en/decoder again if necessary. > Bye, Reiner. Well, it seems to be difficult to improve the message-get-reply-headers function, etc. so that it may parse correctly any words including commas. But it is easy to make Gnus' rfc2047 encoder include the quotes in the encoded words when the quoted text contains non-ASCII characters and commas. An example of the encoded word is in the Cc header of this message. The patch for the Gnus CVS trunk is here: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment --- rfc2047.el~ 2004-11-23 21:49:55 +0000 +++ rfc2047.el 2005-02-14 07:13:18 +0000 @@ -35,6 +35,7 @@ (require 'qp) (require 'mm-util) +(require 'ietf-drums) ;; Fixme: Avoid this (used for mail-parse-charset) mm dependence on gnus. (require 'mail-prsvr) (require 'base64) @@ -337,13 +338,23 @@ ;; Does it need encoding? (goto-char start) (if (re-search-forward encodable-regexp end 'move) - ;; It needs encoding. Strip the quotes first, - ;; since encoded words can't occur in quotes. - (progn - (goto-char end) - (delete-backward-char 1) - (goto-char start) - (delete-char 1) + ;; It needs encoding. + (let ((tspecials (progn + (goto-char (1+ start)) + (re-search-forward + (concat "[" ietf-drums-tspecials "]") + (1- end) t)))) + (if tspecials + ;; Don't strip the quotes which should be + ;; included in the encoded word, since there + ;; are special characters. + (goto-char start) + ;; Strip the quotes first, since encoded words + ;; can't occur in quotes. + (goto-char end) + (delete-backward-char 1) + (goto-char start) + (delete-char 1)) (when last-encoded ;; There was a preceding quoted word. We need ;; to include any separating whitespace in this @@ -354,7 +365,9 @@ (setq start (point) end (1+ end))) ;; Adjust the end position for the deleted quotes. - (rfc2047-encode start (- end 2)) + (rfc2047-encode start (if tspecials + end + (- end 2))) (setq last-encoded t)) ; record that it was encoded (setq last-encoded nil))) ((eq ?. csyntax) @@ -766,8 +779,7 @@ (let* ((rfc2047-encoding-type 'mime) (rfc2047-encode-max-chars nil) (string (rfc2047-encode-string value))) - (if (string-match "[][()<>@,;:\\\"/?=]" ;; tspecials - string) + (if (string-match (concat "[" ietf-drums-tspecials "]") string) (format "%s=%S" param string) (concat param "=" string)))) --=-=-=--