From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67645 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus should accept UTF8 even if UTF-8 is standard Date: Tue, 21 Oct 2008 09:01:45 +0900 Organization: Emacsen advocacy group Message-ID: References: <87iqruvs19.fsf@jidanni.org> <86od1mj3z2.fsf@lifelogs.com> <86od1lg3xq.fsf@lifelogs.com> <87d4i1iqpq.fsf@marauder.physik.uni-ulm.de> <86k5c9fzm9.fsf@lifelogs.com> <878wsph5xr.fsf@marauder.physik.uni-ulm.de> <86d4i1ft75.fsf@lifelogs.com> <873air44me.fsf@marauder.physik.uni-ulm.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224553640 19214 80.91.229.12 (21 Oct 2008 01:47:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2008 01:47:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16096@lists.math.uh.edu Tue Oct 21 03:48:20 2008 connect(): Connection refused 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 1Ks6M5-00052m-MQ for ding-account@gmane.org; Tue, 21 Oct 2008 03:48:18 +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 1Ks6Jt-0006x3-Rm; Mon, 20 Oct 2008 20:46:01 -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 1Ks6Js-0006wu-LZ for ding@lists.math.uh.edu; Mon, 20 Oct 2008 20:46:00 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Ks6Jp-0007as-BE for ding@lists.math.uh.edu; Mon, 20 Oct 2008 20:46:00 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Ks6Jw-0006Hh-00 for ; Tue, 21 Oct 2008 03:46:04 +0200 Original-Received: from localhost ([127.0.0.1]:38869) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1Ks4h1-0005oK-Ge for ding@gnus.org; Mon, 20 Oct 2008 19:01:48 -0500 X-Hashcash: 1:20:081021:ding@gnus.org::83S2dMwphqfanwNE:00004iIQ 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/23.0.60 (gnu/linux) Cancel-Lock: sha1:HSBKHYGT/PGoj/vAkmzpd99JT1E= 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.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67645 Archived-At: >>>>> Reiner Steib wrote: > On Thu, Oct 16 2008, Katsumi Yamaoka wrote: >> Note that adding (utf8 . utf-8) to `mm-charset-synonym-alist' >> causes the same problem (I verified it with Emacs 22.3). > I'm surprised that `mm-charset-synonym-alist' has any effect on > outgoing messages. I though it would only be used when displaying an > article. Could you please investigate this? That is due to `mml-generate-mime-1' that uses the charset specified as is (for encoding, it uses the valid coding system derived from that charset according to `mm-charset-synonym-alist', though). It's a bug, I have two solutions, and I like the second one: 1. Bind `mm-charset-synonym-alist' (and `mm-charset-eval-alist') to nil when encoding. And signal an error if the charset is invalid. 2. Replace the charset that is an alias with the valid one that Emacs knows. Although it violates the idea that "the charset aliases would be used only when displaying an article", it will be convenience for users. WDYT? The patches for 1. and 2. are below: Patch1: --8<---------------cut here---------------start------------->8--- --- mml.el~ 2008-10-03 05:47:11 +0000 +++ mml.el 2008-10-20 23:58:29 +0000 @@ -476,8 +476,11 @@ "application/octet-stream") "text/plain"))) (charset (cdr (assq 'charset cont))) - (coding (mm-charset-to-coding-system charset)) + (coding (let (mm-charset-eval-alist mm-charset-synonym-alist) + (mm-charset-to-coding-system charset))) encoding flowed coded) + (unless coding + (error "Unknown charset: %s" charset)) (cond ((eq coding 'ascii) (setq charset nil coding nil)) --8<---------------cut here---------------end--------------->8--- Patch2: --8<---------------cut here---------------start------------->8--- --- mml.el~ 2008-10-03 05:47:11 +0000 +++ mml.el 2008-10-20 23:58:29 +0000 @@ -482,7 +482,12 @@ (setq charset nil coding nil)) (charset - (setq charset (intern (downcase charset))))) + ;; `charset' might be an alias that `mm-charset-synonym-alist' + ;; provides and might not be in common use, so we prefer + ;; the one that Emacs knows for `coding'. + (setq charset (if coding + (mm-coding-system-to-mime-charset coding) + (intern (downcase charset)))))) (if (and (not raw) (member (car (split-string type "/")) '("text" "message"))) (progn --8<---------------cut here---------------end--------------->8--- Regards,