From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What does `undecided' do for encoding text? Date: Tue, 10 Feb 2009 13:47:45 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234266494 7389 80.91.229.12 (10 Feb 2009 11:48:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2009 11:48:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 10 12:49:29 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LWr7F-0005a5-Pf for ged-emacs-devel@m.gmane.org; Tue, 10 Feb 2009 12:49:26 +0100 Original-Received: from localhost ([127.0.0.1]:58387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWr5w-0007pI-Co for ged-emacs-devel@m.gmane.org; Tue, 10 Feb 2009 06:48:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWr5r-0007ow-TA for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:47:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWr5q-0007oj-DE for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:47:58 -0500 Original-Received: from [199.232.76.173] (port=33883 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWr5q-0007oe-8l for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:47:58 -0500 Original-Received: from mtaout6.012.net.il ([84.95.2.16]:57175) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWr5p-0004hs-4p for emacs-devel@gnu.org; Tue, 10 Feb 2009 06:47:57 -0500 Original-Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KEU00700LYF1I00@i-mtaout6.012.net.il> for emacs-devel@gnu.org; Tue, 10 Feb 2009 13:48:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.128.7]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KEU00K1XM4CO250@i-mtaout6.012.net.il>; Tue, 10 Feb 2009 13:48:13 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108950 Archived-At: > From: Kenichi Handa > CC: emacs-devel@gnu.org > Date: Tue, 10 Feb 2009 20:16:53 +0900 > > > This may have nothing to do with what the programmer did. My use case > > was in Rmail: if the original message had non-ASCII text encoded with > > QP or B64, Rmail would (correctly) return `undecided' when it detects > > the message encoding. Suppose you then edit the message and add > > non-ASCII characters as raw bytes, e.g. by base64-decode-region, and > > type "C-c C-c". rmail-cease-edit now needs to encode the text and put > > it back into the mbox buffer, and the immediate choice it has for the > > pertinent coding-system is to use buffer-file-coding-system of the > > buffer where the message was edited. But the value of > > buffer-file-coding-system in that buffer is `undecided'... > > The situation is the same as visiting an ASCII only file, > entering some non-ASCII characters, and saving it. In that > case, we use selecte-safe-coding-system to decide the coding > system to encode the buffer contents. I think that's a different situation: base64-decode-region inserts raw bytes, not non-ASCII characters. So select-safe-coding-system may not work correctly, because (AFAIK) it was not designed for that case.