Subject: bug#72542: closed (Re: bug#72542: 31.0.50; EasyPG adds ^M in encrypting files with DOS-eol on Windows)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 10 Aug 2024 07:56:02 +0000

Your bug report

#72542: 31.0.50; EasyPG adds ^M in encrypting files with DOS-eol on Windows

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
72542: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72542
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#72542: 31.0.50; EasyPG adds ^M in encrypting files with DOS-eol on Windows
From: Eli Zaretskii <[email-masked]>
To: Kazuhiro Ito <[email-masked]>
Cc: [email-masked]
Date: Sat, 10 Aug 2024 10:55:12 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Fri, 09 Aug 2024 21:38:59 +0900
> From: Kazuhiro Ito <[email-masked]>
> 
> 1. Create or open an encrypted text file, which has .gpg suffix.
> 2. Save the file with DOS-eol. (C-x RET f utf-8-dos and C-x C-s)
> 3. Kill buffer and re-open it.
> 
> I can see ^M garbage in each eol.  I noticed it because Wanderlust (a
> mailer) failed to verify signature on Windows.  Attached patch can
> resolve the issue.

Thanks, installed on the emacs-30 release branch, and closing the bug.

Subject: 31.0.50; EasyPG adds ^M in encrypting files with DOS-eol on Windows
From: Kazuhiro Ito <[email-masked]>
To: [email-masked]
Date: Fri, 09 Aug 2024 21:38:59 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

1. Create or open an encrypted text file, which has .gpg suffix.
2. Save the file with DOS-eol. (C-x RET f utf-8-dos and C-x C-s)
3. Kill buffer and re-open it.

I can see ^M garbage in each eol.  I noticed it because Wanderlust (a
mailer) failed to verify signature on Windows.  Attached patch can
resolve the issue.

-- 
Kazuhiro Ito
>From 63eabd45e894c643a38b80de717291afe971f6fa Mon Sep 17 00:00:00 2001
From: Kazuhiro Ito <[email-masked]>
Date: Fri, 9 Aug 2024 21:28:41 +0900
Subject: [PATCH] * lisp/epg.el (epg--start): Don't convert EOL in encoding.

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

diff --git a/lisp/epg.el b/lisp/epg.el
index 494bdd68c41..6b4db52f298 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -683,7 +683,7 @@ epg--start
     ;; We encode and decode ourselves the text sent/received from gpg,
     ;; so the below disables automatic encoding and decoding by
     ;; subprocess communications routines.
-    (set-process-coding-system process 'raw-text 'raw-text)
+    (set-process-coding-system process 'raw-text 'raw-text-unix)
     (setf (epg-context-process context) process)))
 
 (defun epg--process-filter (process input)
-- 
2.45.1