Subject: bug#33040: 26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase

From: [email-masked] (Pierre Téchoueyres)
Date: Wed, 24 Oct 2018 21:21:07 +0200

Hello Eli,
please find the patch bellow.
>From 32644ac1027114d3f4caaf2e25ae985241ab867b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <[email-masked]>
Date: Sun, 14 Oct 2018 17:49:12 +0200
Subject: [PATCH] Unify prompt for gnupg passphrase between GNU/Linux and
 Windows.

* lisp/epg.el (epg--start): Use `raw-text' for coding system instead
  of binary in order to avoid spurious carriage return on Microsoft
  Windows and DOS when prompting for a password.
---
 lisp/epg.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index 8f26cd34ee..28afa59d8e 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -655,7 +655,7 @@ epg--start
 				  :command (cons (epg-context-program context)
 						 args)
 				  :connection-type 'pipe
-				  :coding '(binary . binary)
+				  :coding 'raw-text
 				  :filter #'epg--process-filter
 				  :stderr error-process
 				  :noquery t)))
-- 
2.17.2

Eli Zaretskii <[email-masked]> writes:
>> Sorry, when :coding 'raw-text-unix didn't work as expected I first try
>> 
>> :coding (if (memq system-type '(ms-dos windows-nt))
>>              'raw-text-dos
>>          'raw-text-unix)
>> 
>> then I realized it was equivalent to :
>> :coding 'raw-text
>
> Actually, no: it isn't equivalent.  Just raw-text tells Emacs to use
> the default on encoding (thus -dos on Windows and -unix on GNU/Linux),
> and to _detect_ the EOL format on decoding.  But I don't think this is
> a problem in this case, is it?
>

No, it isn't a problem, and on the contrary it's exactly what I want :
detect the EOL format for decoding.