all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
To: 44307@debbugs.gnu.org
Cc: larsi@gnus.org
Subject: bug#44307: 27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode
Date: Tue, 05 Jan 2021 11:00:58 +0100	[thread overview]
Message-ID: <87o8i3g0th.fsf@goulash.lrde.epita.fr> (raw)
In-Reply-To: <87h7nwbc6t.fsf@goulash.lrde.epita.fr> (Alexandre Duret-Lutz's message of "Mon, 04 Jan 2021 22:54:18 +0100")

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:
> In my case the (mm-handle-buffer handle) is multibyte.  This
> multibyteness was preserved by mm-copy-to-buffer while creating the
> handle buffer, but a did not check the original source of it, since the
> comment above the macro suggests that having multibyte parts is OK.

I think I understand why the bug cannot be reproduced using nndoc in
emacs 28.  The following patch, which fixes the unibyteness of the nndoc
buffer is not part of emacs 27:

commit 9d0385d7c7adc810dfd06321b783593b7afb3d58
Author: Lars Ingebrigtsen <larsi@gnus.org>
Date:   Fri Aug 21 15:36:45 2020 +0200

    Fix problem with 8bit content-transfer-encoding in nndoc mbox files
    
    * lisp/gnus/nndoc.el (nndoc-possibly-change-buffer): If we're
    reading an mbox file, it may contain messages that use
    content-transfer-encoding 8bit, which means that we have to treat
    the file as a sequence of byte (bug#42951).  This avoids
    double-decoding -- once by Emacs when inserting the mbox into the
    buffer, and once by Gnus when displaying the articles.


So when mm-with-part process the MIME parts of the problematic message
read from the nndoc group, it receives a multibyte buffer in Emacs 27
but a unibyte buffer in Emacs 28. 

However the issue is not restricted to nndoc.

With both emacs 27 & 28 I'm still having the original issue with mail
read using nnmaildir.  So maybe nnmaildir deserves a similar fix?
I'm not quite sure where that would go.  nnmaildir-request-article?

In any way I'm currently running Gnus with the following change:

--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1264,8 +1264,8 @@ mm-with-part
      (when (and (mm-handle-buffer handle)
                (buffer-name (mm-handle-buffer handle)))
        (with-temp-buffer
-        (mm-disable-multibyte)
         (insert-buffer-substring (mm-handle-buffer handle))
+        (mm-disable-multibyte)
         (mm-decode-content-transfer-encoding
          (mm-handle-encoding handle)
          (mm-handle-media-type handle))

and that seems to solve my problem in both version of Emacs, and in both
nndoc or nnmaildir.

-- 
Alexandre Duret-Lutz





  reply	other threads:[~2021-01-05 10:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 14:09 bug#44307: 27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode Thomas Schneider
2020-10-30 13:10 ` Lars Ingebrigtsen
2020-10-30 13:26   ` Andreas Schwab
2020-10-30 13:35     ` Lars Ingebrigtsen
2020-10-30 14:53       ` Andreas Schwab
2020-11-01 12:10         ` Lars Ingebrigtsen
2020-11-01 12:15           ` Andreas Schwab
2020-11-02 14:56             ` Lars Ingebrigtsen
2020-10-30 13:28 ` Andreas Schwab
2021-01-02 20:26 ` Alexandre Duret-Lutz
2021-01-04 21:54   ` Alexandre Duret-Lutz
2021-01-05 10:00     ` Alexandre Duret-Lutz [this message]
2021-01-07 13:43       ` Lars Ingebrigtsen
2021-01-05  9:30   ` Lars Ingebrigtsen
2021-01-05 10:07     ` Alexandre Duret-Lutz
2021-01-05 10:14       ` Lars Ingebrigtsen
2021-01-05 11:17         ` Alexandre Duret-Lutz
2021-01-07 14:14       ` Lars Ingebrigtsen
2021-01-07 16:06         ` Alexandre Duret-Lutz
2021-01-07 16:10           ` Lars Ingebrigtsen
2021-01-07 17:07             ` Alexandre Duret-Lutz
2021-01-10 12:27           ` Lars Ingebrigtsen
2021-01-10 14:02             ` Alexandre Duret-Lutz
2021-01-10 14:11               ` Lars Ingebrigtsen
2021-01-10 14:48                 ` Alexandre Duret-Lutz
2021-01-10 15:21                   ` Alexandre Duret-Lutz
2021-01-11 14:28                     ` Lars Ingebrigtsen
2021-02-02 11:36                       ` Alexandre Duret-Lutz
2021-02-04  8:04                         ` Lars Ingebrigtsen

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=87o8i3g0th.fsf@goulash.lrde.epita.fr \
    --to=adl@lrde.epita.fr \
    --cc=44307@debbugs.gnu.org \
    --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.