all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: "Adam Sjøgren" <asjo@koldfront.dk>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 38512@debbugs.gnu.org
Subject: bug#38512: 27.0.50; Reading PGP-signed email from people with non-ascii names give error
Date: Mon, 09 Dec 2019 17:26:08 +0100	[thread overview]
Message-ID: <m2immpfotb.fsf@gmail.com> (raw)
In-Reply-To: <87v9qtfame.fsf@tullinup.koldfront.dk>

>>>>> On Fri, 06 Dec 2019 21:43:37 +0100, "Adam Sjøgren <asjo@koldfront.dk>" said:

    Adam> Recently, when I read an email that has been PGP-signed and/or encrypted
    Adam> by a person who has non-ascii chars in their name in the PGP-key, Gnus
    Adam> gives an error on the email, showing this message:

    Adam>   epg--decode-percent-escape: Can’t convert the 8th character to unibyte

    Adam> This also means I can't read encrypted emails I have sent myself.

    Adam> I have bisected the problem to this commit:

    Adam>   98387b9e2455b0bd5a2aafe6fac939fb111eedce is the first bad commit
    Adam>   commit 98387b9e2455b0bd5a2aafe6fac939fb111eedce
    Adam>   Author: Lars Ingebrigtsen <larsi@gnus.org>
    Adam>   Date:   Wed Oct 23 10:50:29 2019 +0200

    Adam>       Make display of S/MIME signatures slightly better

    Adam>       * lisp/epg.el (epg-signature-to-string): Decode percent escapes
    Adam>       (bug#36101).

    Adam>    lisp/epg.el | 2 +-
    Adam>    1 file changed, 1 insertion(+), 1 deletion(-)

If I remember correctly what Eli taught me the last time this kind of
discussion came up, this should fix it:

diff --git a/lisp/epg.el b/lisp/epg.el
index 090317f422..5466716e34 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -2032,7 +2032,7 @@ epg-edit-key
     (epg-reset context)))
 
 (defun epg--decode-percent-escape (string)
-  (setq string (string-to-unibyte string))
+  (setq string (encode-coding-string string 'raw-text))
   (let ((index 0))
     (while (string-match "%\\(\\(%\\)\\|\\([[:xdigit:]][[:xdigit:]]\\)\\)"
 			 string index)





  reply	other threads:[~2019-12-09 16:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 20:43 bug#38512: 27.0.50; Reading PGP-signed email from people with non-ascii names give error Unknown
2019-12-09 16:26 ` Robert Pluim [this message]
2019-12-09 17:08   ` Unknown
2019-12-11 12:33     ` Robert Pluim
2019-12-11 16:33       ` Eli Zaretskii
2019-12-12  7:37         ` Robert Pluim

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=m2immpfotb.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=38512@debbugs.gnu.org \
    --cc=asjo@koldfront.dk \
    --cc=larsi@gnus.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.