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: buffer-swap-text and multibyteness Date: Sat, 21 Feb 2009 17:12:11 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1235229150 1920 80.91.229.12 (21 Feb 2009 15:12:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2009 15:12:30 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, rms@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 21 16:13:45 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 1LatXx-0000VJ-Dj for ged-emacs-devel@m.gmane.org; Sat, 21 Feb 2009 16:13:41 +0100 Original-Received: from localhost ([127.0.0.1]:41228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LatWd-0007mu-07 for ged-emacs-devel@m.gmane.org; Sat, 21 Feb 2009 10:12:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LatWX-0007mG-4Q for emacs-devel@gnu.org; Sat, 21 Feb 2009 10:12:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LatWW-0007m1-5z for emacs-devel@gnu.org; Sat, 21 Feb 2009 10:12:12 -0500 Original-Received: from [199.232.76.173] (port=58108 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LatWW-0007ly-2b for emacs-devel@gnu.org; Sat, 21 Feb 2009 10:12:12 -0500 Original-Received: from mtaout1.012.net.il ([84.95.2.1]:27485) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LatWU-0000B6-UO; Sat, 21 Feb 2009 10:12:11 -0500 Original-Received: from conversion-daemon.i-mtaout1.012.net.il by i-mtaout1.012.net.il (HyperSendmail v2007.08) id <0KFF008008HBPF00@i-mtaout1.012.net.il>; Sat, 21 Feb 2009 17:12:43 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.82.14]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KFF00B3C8X58G90@i-mtaout1.012.net.il>; Sat, 21 Feb 2009 17:12:42 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:109278 Archived-At: > From: Kenichi Handa > CC: monnier@iro.umontreal.ca, rms@gnu.org, emacs-devel@gnu.org > Date: Tue, 10 Feb 2009 20:52:00 +0900 > > Please try your method with this mail. > > Here, I enter Japanese "Hello": > こんにちは > > And, here I enter base64-encoded Latin-1 text: > > ICAgICBBeCCgIKEgoiCjIKQgpSCmIKcgqCCpIKogqyCsIK0griCvCiAgICAgQnggsCCxILIgsyC0 > ILUgtiC3ILgguSC6ILsgvCC9IL4gvwogICAgIEN4IMAgwSDCIMMgxCDFIMYgxyDIIMkgyiDLIMwg > zSDOIM8KICAgICBEeCDQINEg0iDTINQg1SDWINcg2CDZINog2yDcIN0g3iDfCiAgICAgRXgg4CDh > IOIg4yDkIOUg5iDnIOgg6SDqIOsg7CDtIO4g7wogICAgIEZ4IPAg8SDyIPMg9CD1IPYg9yD4IPkg > +iD7IPwg/SD+IP8K > > And, I send this message itself using charset=iso-2022-jp. You are right, rmail-cease-edit was too naive in selecting the correct encoding. I think I fixed your use-case now, please try. After base64 decoding the Latin-1 text and manually decoding the text with decode-coding-region, if buffer-file-coding-system cannot safely encode the message, Emacs will ask you to select a safe encoding when you type C-c C-c. You can also set the correct encoding manually before you type C-c C-c. The charset= header is rewritten as needed, as part of putting the modified message back into the message collection buffer.