Subject: Re: bug#44307: 27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode

From: Alexandre Duret-Lutz <[email-masked]>
Date: Sun, 10 Jan 2021 16:21:08 +0100

Alexandre Duret-Lutz <[email-masked]> writes:

> I don't understand why nnheader-insert-file-contents with 'raw-text
> coding does not seem to work as desired on a multibyte-buffer.

OK, that was silly: nnheader-insert-file-contents resets
coding-system-for-read to 'undecided.

The following also seems to fix the rendering of all my mails.

diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index e4fd976742..2a4c74db5e 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -1351,7 +1351,8 @@ nnmaildir-request-article
 	(throw 'return nil))
       (with-current-buffer (or to-buffer nntp-server-buffer)
 	(erase-buffer)
-	(nnheader-insert-file-contents nnmaildir-article-file-name))
+	(let ((coding-system-for-read mm-text-coding-system))
+	  (mm-insert-file-contents nnmaildir-article-file-name)))
       (cons gname num-msgid))))
 
 (defun nnmaildir-request-post (&optional _server)

-- 
Alexandre Duret-Lutz