GNU bug report logs - #39506
mm-shr unibyte assumption

Previous Next

Packages: gnus, emacs;

Reported by: dick <dick.r.chiang <at> gmail.com>

Date: Sat, 8 Feb 2020 00:41:02 UTC

Severity: normal

Tags: notabug

Done: dick <dick.r.chiang <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: dick.r.chiang <at> gmail.com
Cc: 39506 <at> debbugs.gnu.org
Subject: bug#39506: patch
Date: Sat, 08 Feb 2020 14:51:02 -0500
>> - Before deciding whether unibyte or multibyte is the right choice, the
>>   main question is whether the buffer contains bytes or chars.
> My buffer contained some Chinese multibytes.

That suggests it contains characters rather than bytes.  How did
that happen?  Where does this buffer ('s contents) come from?

> You can see my unit test in the patch.

In your unit test, you artificially create a multibyte buffer with
chinese chars, so that doesn't answer my question ;-)

AFAIK `mm-with-part` is designed for MIME parts and MIME parts can only
contain bytes at that point.  Only after we extract them as bytes and
apply `mm-decode-content-transfer-encoding` to it can we consider
decoding those bytes into chars.

So I suspect that the source of your problem is earlier, where some code
incorrectly decodes some content too early.  Hence the need to better
understand where those chinese chars come from.


        Stefan





This bug report was last modified 5 years and 129 days ago.

Previous Next


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