help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs refusing to switch to iso-latin-1


From: Stefan Monnier
Subject: Re: Emacs refusing to switch to iso-latin-1
Date: Thu, 14 Feb 2008 14:58:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>> But, for me, this does not explain why my request to "use
>> iso-latin-1-unix for saving this buffer" is not respected.

> Because your file does not start with
> <?xml version="1.0" encoding="ISO-8859-1"?>

I don't know for a fact that this is the reason, but it's indeed quite
likely: sgml-xml-auto-coding-function seems to enforce it.  The way this
works is that when Emacs saves a file is tries to use the encoding that
it would use when reading the file (this is necessary in order to
ensure that saving and reloading gives the same text, which I hope you
agree is important).  Since XML files are decoded as utf-8 by default,
Emacs has to save it as utf-8 by default.

The bug really is in C-x RET f: it should complain that the file's
header specify utf-8 encoding (in this case by omission) and hence
latin-1 cannot be used.

Please report it as a bug via M-x report-emacs-bug.


        Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]