GNU bug report logs - #44307
27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode

Previous Next

Packages: emacs, gnus;

Reported by: Thomas Schneider <qsx <at> chaotikum.eu>

Date: Thu, 29 Oct 2020 14:12:01 UTC

Severity: normal

Tags: fixed

Merged with 45657

Found in version 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alexandre Duret-Lutz <adl <at> lrde.epita.fr>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44307 <at> debbugs.gnu.org
Subject: bug#44307: 27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode
Date: Tue, 05 Jan 2021 12:17:38 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Alexandre Duret-Lutz <adl <at> lrde.epita.fr> writes:
>
>> Here is the file.  But see by previous message from today.  Reading this
>> with nndoc will appear bogus with emacs 27.1, but not with emacs 28.
>> However if there is a way to read that mail with nnmaildir, you should
>> see the issue with both versions.
>
> Thanks for the test file (and the analysis of the differences between
> 27.1 and 28 here).  I'll try to work on fix for this in Emacs 27
> tomorrow -- I'm not sure the simple fix you outlined won't have adverse
> effects if the part in question is binary (i.e., an image or the like).

Sorry, you can ignore my simple "fix": I have now found a case that it
breaks.

I was testing mainly on utf-8 messages.  But I've now looked (through
nnmaildir) at a mail containing a part encoded as follow:

Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit

However the rendering was garbled.  Looking ag the output of "C-u g" I
can see that the buffer contains utf-8 code (I'm guessing because that
the windows-1252 representation was decoded when nnmaildir read the mail
from file), and that will make no sense once Gnus attempts to decode
that in windows-1252.

Without my incorrect patch, displaying such an email would appear to
work (by luck?), because when mm-with-part inserts the multibyte buffer
into the unibyte buffer, the utf-8 characters are somehow converted to
their windows-1252 equivalent encoding.

I guess the real issue is that mmaildir does not correctly deal with
multibyte files et may return multibyte buffer, just like nndoc used to.
-- 
Alexandre Duret-Lutz




This bug report was last modified 4 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.