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

From: Kazuhiro Ito <[email-masked]>
Date: Fri, 09 Aug 2024 21:38:59 +0900

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