From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65080 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: (Re-)coding problems forwarding calendar attachment Date: Fri, 24 Aug 2007 19:22:41 +0900 Organization: Emacsen advocacy group Message-ID: References: <87d4xfenht.fsf@obelix.mork.no> <87y7g2p8ys.fsf@obelix.mork.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1187951200 31958 80.91.229.12 (24 Aug 2007 10:26:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Aug 2007 10:26:40 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13590@lists.math.uh.edu Fri Aug 24 12:26:27 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 1IOWLF-0008Ld-9I for ding-account@gmane.org; Fri, 24 Aug 2007 12:24:39 +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 1IOWK9-00025V-7H; Fri, 24 Aug 2007 05:23:29 -0500 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 1IOWK7-00025H-R3 for ding@lists.math.uh.edu; Fri, 24 Aug 2007 05:23:27 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IOWK4-0003jt-BI for ding@lists.math.uh.edu; Fri, 24 Aug 2007 05:23:27 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IOWK2-0006vR-00 for ; Fri, 24 Aug 2007 12:23:22 +0200 Original-Received: from [66.225.201.151] (port=34364 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1IOWJT-0006dP-KN for ding@gnus.org; Fri, 24 Aug 2007 05:22:48 -0500 X-Hashcash: 1:20:070824:ding@gnus.org::4FJx+0t1bpOuBlX6:00008W/7 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/22.1.50 (gnu/linux) Cancel-Lock: sha1:k4ISWRcDtWgXcsR3AjeHhCHX1Lo= 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 - [0 0] / [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:65080 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >>>>> Bj=F8rn Mork wrote: > Katsumi Yamaoka writes: >> I've modified Gnus so as to use UTF-8 by default for decoding >> text/calender parts. > Probably good, but may cause problems with pre-RFC (version 1.0) > text/calendar parts. Let's hope everybody using those were sending > strict US-ASCII (possibly using QP to encode other charsets) Well, if the text/calendar part is encoded by arbitrary charset other than UTF-8 but has no charset spec in the Content-Type header, there will be no way to detect it automatically. Though, we can guess it and apply it through the `K C' command. > But it still doesn't work. The attachment is encoded as > quoted-printable and gets this header: > Content-Type: text/calendar; charset=3Diso-8859-1; name=3Dmeeting.ics > Content-Transfer-Encoding: quoted-printable > But it is not converted from utf-8, so that '=E6' is coded as '=3DC3=3DA6= ', > '=E5' as '=3DC3=3DA5' etc. > Everything would have been fine if Gnus had just used > Content-Type: text/calendar; charset=3Dutf-8; name=3Dmeeting.ics > Content-Transfer-Encoding: quoted-printable > Any idea where this confusion comes from? I probably have understood what is a prerequisite when one hands iCalendar files to others. The text/calendar part that has been encoded by the iso-8859-1 charset is indeed a valid MIME message. However, when a recipient saves the part in a file and passes it to the calendar program, or passes it to the program through the pipe, the charset is unlikely to be notified to the program. Therefor, there needs to be an implicit agreement. That is just UTF-8, isn't it? I've changed Gnus' encoder so that UTF-8 is most preferred when encoding text/calendar parts. Actually, now Gnus will never use the charset other than UTF-8. It is not a matter that the Content-Transfer-Encoding is QP or base64, is it? Gnus may use base64 as the case may be. If it has to always be QP, I have a plan: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- mml.el~ 2007-08-24 08:17:16 +0000 +++ mml.el 2007-08-24 10:18:56 +0000 @@ -535,15 +535,18 @@ ;; insert a "; format=flowed" string unless the ;; user has already specified it. (setq flowed (null (assq 'format cont))))) - ;; Prefer `utf-8' for text/calendar parts. + ;; Prefer `utf-8' and QP for text/calendar parts. (if (or charset (not (string= type "text/calendar"))) - (setq charset (mm-encode-body charset)) + (setq charset (mm-encode-body charset) + encoding (mm-body-encoding + charset (cdr (assq 'encoding cont)))) (let ((mm-coding-system-priorities (cons 'utf-8 mm-coding-system-priorities))) - (setq charset (mm-encode-body)))) - (setq encoding (mm-body-encoding - charset (cdr (assq 'encoding cont)))))) + (setq charset (mm-encode-body) + encoding (mm-body-encoding + charset (or (cdr (assq 'encoding cont)) + 'quoted-printable))))))) (setq coded (buffer-string))) (mml-insert-mime-headers cont type charset encoding flowed) (insert "\n") --=-=-= Content-Disposition: inline P.S. I will be inactive in the net for a week because of the holidays. --=-=-=--