Subject: Re: bug#21574: po-mode mishandles ASCII files

From: Paul Eggert <[email-masked]>
Date: Mon, 28 Sep 2015 07:55:12 -0700

On 09/28/2015 03:18 AM, Eli Zaretskii wrote:
> do we have a similar problem in other files that have entries in
> file-coding-system-alist, like XML files or LaTeX files?

Not with XML, because xml-find-file-coding-system only tries 
detect-coding-region.

But there is a problem with LaTeX.  For example, if I visit a file like 
this:

   \usepackage[ascii]{inputenc}
   hello

The default coding system for saving the buffer is us-ascii-unix, which 
is correct (and is better than what we get with .po files). But if I 
then insert a non-ASCII character, say á, and type C-x C-s, Emacs 
changes the coding system to utf-8-unix without asking and saves the 
file.  If I then revisit the file I get garbage: the á is decoded as two 
bytes and I see \303\241 on the screen.