all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <83634f3ady.fsf@gnu.org> (raw)
In-Reply-To: <20100328204351.GA2402@muc.de>

> Date: Sun, 28 Mar 2010 20:43:51 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> 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) ü
> ("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?

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.

> Is it causing me problems?

It shouldn't.

> 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?

> Why is Emacs insisting on trying to be so clever?

Because it's Emacs ;-)





  parent reply	other threads:[~2010-03-29  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 20:43 How do I read and write an iso-8859-1 file in Emacs 23? Alan Mackenzie
2010-03-28 21:11 ` Peter Dyballa
2010-03-29  6:33 ` Eli Zaretskii [this message]
2010-03-30 10:42   ` Alan Mackenzie
2010-03-30 11:33     ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83634f3ady.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.