From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: How do I read and write an iso-8859-1 file in Emacs 23? Date: Tue, 30 Mar 2010 13:33:44 +0200 Message-ID: <4BB1E198.4070402@easy-emacs.de> References: <20100328204351.GA2402@muc.de> <83634f3ady.fsf@gnu.org> <20100330104222.GA3122@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1269947329 19996 80.91.229.12 (30 Mar 2010 11:08:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 11:08:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alan Mackenzie Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 30 13:08:43 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 1NwZJJ-0005MD-Vt for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Mar 2010 13:08:42 +0200 Original-Received: from localhost ([127.0.0.1]:36778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwZJJ-0001Tq-0D for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Mar 2010 07:08:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwZIs-0001Sx-8m for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 07:08:14 -0400 Original-Received: from [140.186.70.92] (port=59262 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwZIn-0001P5-4v for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 07:08:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwZIk-0006RI-UP for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 07:08:08 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:65132) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwZIk-0006R4-FW for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 07:08:06 -0400 Original-Received: from [192.168.178.27] (p54BE8EE5.dip0.t-ipconnect.de [84.190.142.229]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MFzpm-1Nl2Rx0f6U-00ELch; Tue, 30 Mar 2010 13:08:04 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <20100330104222.GA3122@muc.de> X-Provags-ID: V01U2FsdGVkX19sv4tA8unSVCFflJdoEeOu2Ti+v3UHBtIu93D 8JRbv+x9IM/guUexjUCVvfgNWkZob6xJYtVI4YKW9o7HN/CI30 vkU8gwoVaENfi02tGDiqwHKdZ4/7kj6jvYabbcqbsM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:72545 Archived-At: Alan Mackenzie wrote: > Hi, Eli, > > On Mon, Mar 29, 2010 at 09:33:13AM +0300, Eli Zaretskii wrote: >>> Date: Sun, 28 Mar 2010 20:43:51 +0000 >>> From: Alan Mackenzie > >>> the subject just about says everything. > >> It is strange to read such questions in the year 2010 regarding Emacs >> 23. > > I feel that Emacs 23 is less stable in this respect than Emacs 22. > >>> Emacs 23 insists on fouling up my text, converting (for example) ü >>> ("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 =" >> with point on the ü (before it is converted to \374)? Also, how did >> you insert that character into the buffer? > > My buffer is now doing the Right Thing, both displaying a ü ("u umlaut") > as it should be, and saving it correctly as the single byte 0xfc. > Previously, it was sometimes being displayed as "\374" as I typed. I > don't know exactly what I did to achieve this; I'm thoroughly confused > about it. That's a very old, known issue. Reported it years ago. As it happens seldom, I'm able to live with. It happens sometimes, if text is pasted from an email. Than umlauts are displayed as (their) numbers. Workaround is to mark the whole buffer, copy it into another one. In the next buffer umlauts are shown correctly. Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/ > > To insert the ü, I typed a key-combination programmed to generate 0xFC > on a Linux virtual terminal. > >> 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: > >>> -*- mode : Text ; buffer-file-coding-system : iso-8859-1-unix -*- > >>> . Should this help? > >> Yes. But it shouldn't be needed in most situations. > > I've since removed it. > >>> Is it causing me problems? > >> It shouldn't. > > Thanks! > >>> What am I missing here? All I want to do is read an 8859-1 text file, >>> 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 else. > >> 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? > > I've lost that info, now. It was probably raw-text or no-translation > (whatever the difference is between these two). > >>> Why is Emacs insisting on trying to be so clever? > >> Because it's Emacs ;-) > > Ah, OK! >