unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71080@debbugs.gnu.org
Subject: bug#71080: 30.0.50; UTF-8 used unconditionally when saving GPG file
Date: Mon, 20 May 2024 12:38:50 -0400	[thread overview]
Message-ID: <jwvr0dwh2bu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <867cfoa1zs.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 May 2024 19:20:55 +0300")

> How can this work reliably, unless the *.gpg files can have some
> meta-data that tells Emacs how to decode them?

GPG takes bytes in and split bytes out, so there's no encoding
issue there.  The contents in my example very much comes with the needed
meta-data (in the form of a `coding` file-local var).  That meta-data is
correctly used when opening the file (which is why the UTF-8 byte sequence
is not turned into `λ` but is kept as `eight-bit` chars) but not when saving.

> When encoding, we could perhaps use buffer-file-coding-system (AFAICT,
> we do that indirectly now, via select-safe-coding-system), but what to
> do when decoding?

As mentioned, AFAICT we DTRT already when decoding (at least when the
coding system is specified via a file-local var).  The problem is when
saving: `select-safe-coding-system` ends up returning `no-conversion`
despite the `coding:` cookie.

> If _you_ know the correct encoding, you could use "C-x RET c" before
> the commands (as in "C-x RET c iso-2022-7bit RET C-x C-w").  Did you
> try that?

I tried `C-x RET f`.  It makes no difference.  And it should not be
needed since the file-local var states very explicitly what we
should use.


        Stefan






  reply	other threads:[~2024-05-20 16:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 15:43 bug#71080: 30.0.50; UTF-8 used unconditionally when saving GPG file Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-20 16:20 ` Eli Zaretskii
2024-05-20 16:38   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-20 18:00     ` Eli Zaretskii
2024-05-20 21:08       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-23 13:01         ` Eli Zaretskii
2024-05-23 15:44           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-24 20:12             ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-25  6:14               ` Eli Zaretskii
2024-05-25 14:01               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvr0dwh2bu.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71080@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).