From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: What does `undecided' do for encoding text? Date: Wed, 11 Feb 2009 18:20:34 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234344150 28498 80.91.229.12 (11 Feb 2009 09:22:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2009 09:22:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 11 10:23:42 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 1LXBJl-0000nU-Uo for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2009 10:23:42 +0100 Original-Received: from localhost ([127.0.0.1]:49896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXBIS-0008LL-0i for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2009 04:22:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXBGt-00082f-EM for emacs-devel@gnu.org; Wed, 11 Feb 2009 04:20:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXBGr-00082C-V0 for emacs-devel@gnu.org; Wed, 11 Feb 2009 04:20:42 -0500 Original-Received: from [199.232.76.173] (port=36266 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXBGr-000827-Na for emacs-devel@gnu.org; Wed, 11 Feb 2009 04:20:41 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:60619) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXBGl-000802-RA; Wed, 11 Feb 2009 04:20:36 -0500 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n1B9KV69022118; Wed, 11 Feb 2009 18:20:31 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n1B9KVMR003552; Wed, 11 Feb 2009 18:20:31 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id n1B9KVeP024016; Wed, 11 Feb 2009 18:20:31 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1LXBGk-0000sx-Pp; Wed, 11 Feb 2009 18:20:34 +0900 In-reply-to: (message from Eli Zaretskii on Tue, 10 Feb 2009 13:47:45 +0200) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:108981 Archived-At: In article , Eli Zaretskii writes: > > 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. Have you tried it? select-safe-coding-system should suggest raw-text if the buffer contains raw bytes. --- Kenichi Handa handa@m17n.org