From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How do I read and write an iso-8859-1 file in Emacs 23? Date: Mon, 29 Mar 2010 09:33:13 +0300 Message-ID: <83634f3ady.fsf@gnu.org> References: <20100328204351.GA2402@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1269844491 31833 80.91.229.12 (29 Mar 2010 06:34:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2010 06:34:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 29 08:34:45 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw8Yd-0005vt-Ko for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Mar 2010 08:34:43 +0200 Original-Received: from localhost ([127.0.0.1]:42112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nw8Xe-0002WU-KE for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Mar 2010 02:33:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nw8XA-0002VT-D5 for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 02:33:12 -0400 Original-Received: from [140.186.70.92] (port=49240 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nw8X8-0002VL-Sf for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 02:33:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nw8X7-00072B-OP for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 02:33:10 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:42449) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw8X7-000725-Ft for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 02:33:09 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L0100300626IC00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 09:33:07 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L01001PU676GY60@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Mon, 29 Mar 2010 09:33:07 +0300 (IDT) In-reply-to: <20100328204351.GA2402@muc.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72529 Archived-At: > Date: Sun, 28 Mar 2010 20:43:51 +0000 > From: Alan Mackenzie >=20 > the subject just about says everything. It is strange to read such questions in the year 2010 regarding Emacs 23. > Emacs 23 insists on fouling up my text, converting (for example) = =FC > ("u umlaut") into \374 each time I try to save it. It then > complains it can't save \374 because it can't "convert" it. What does Emacs tell about this character when you type "C-u C-x = =3D" with point on the =FC (before it is converted to \374)? Also, how di= d you insert that character into the buffer? I suspect that something causes Emacs to treat it as a raw byte \374, rather than a Latin-1 character. (Yes, Emacs can distinguish between these two.) > In desperation, I tried putting this on the first line of the text: >=20 > -*- mode : Text ; buffer-file-coding-system : iso-8859-1-unix -= *- >=20 > . Should this help? Yes. But it shouldn't be needed in most situations. > Is it causing me problems? It shouldn't. > What am I missing here? All I want to do is read an 8859-1 text fi= le, > edit it, and write it back again. How do I tell Emacs that an 0xFC > character in the file is actually a "u umlaut", and not anything el= se. If you have this trouble in a file you visited and did not modify yet= , it could be that the file includes some raw bytes that don't fit any encoding known to Emacs, or perhaps Emacs detected the encoding incorrectly. What does `buffer-file-coding-system' evaluate to in this buffer, immediately after you visit the file? > Why is Emacs insisting on trying to be so clever? Because it's Emacs ;-)