From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 21574@debbugs.gnu.org
Subject: bug#21574: po-mode mishandles ASCII files
Date: Mon, 28 Sep 2015 13:18:49 +0300 [thread overview]
Message-ID: <838u7qetiu.fsf@gnu.org> (raw)
In-Reply-To: <56084B12.90307@cs.ucla.edu>
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 27 Sep 2015 13:01:22 -0700
>
> Emacs's po-mode mishandles .po files that specify charset=us-ascii. To
> reproduce the problem on Fedora, run 'LC_ALL=cs_CZ.iso88592 emacs -Q fr.po' with
> fr.po being the attached file (taken from Texinfo 6.0), and type '# C-x 8 RET
> 161 RET RET C-x C-s'. The file will be saved with the line '#š' prepended, in
> Latin-2 encoding, even though the file declares its encoding to be
> charset=us-ascii.
I think what you see is a side effect of a feature: when a character
is added that can be safely encoded by the default value of
buffer-file-coding-system, Emacs silently saves the file in that
encoding. This feature was added in response to user requests not to
bother them with annoying requests to select an encoding when all they
did was add some non-ASCII text native to their locale to a file that
was previously ASCII-only.
What we need in this particular case, I think, is some code in po.el
that would function similarly to what we already do when the file has
a coding cookie, and the user adds characters that cannot be saved
with the encoding stated by the cookie.
Btw, do we have a similar problem in other files that have entries in
file-coding-system-alist, like XML files or LaTeX files?
next prev parent reply other threads:[~2015-09-28 10:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 20:01 bug#21574: po-mode mishandles ASCII files Paul Eggert
2015-09-27 23:55 ` Glenn Morris
2015-09-27 23:56 ` Glenn Morris
2015-09-27 23:58 ` Glenn Morris
2015-09-28 2:20 ` Paul Eggert
2015-09-28 6:43 ` Eli Zaretskii
2015-09-28 10:18 ` Eli Zaretskii [this message]
2015-09-28 14:55 ` Paul Eggert
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=838u7qetiu.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=21574@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/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.