GNU bug report logs - #79376
[PATCH] [WIP] Fix mm multibyte

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Wed, 3 Sep 2025 09:34:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: 79376 <at> debbugs.gnu.org
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>, MORIOKA Tomohiko <morioka <at> jaist.ac.jp>
Subject: bug#79376: [PATCH] [WIP] Fix mm multibyte
Date: Wed, 03 Sep 2025 11:33:33 +0200
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

I'm trying to fix an issue in Gnus where some Atom sources (namely
planet.emacslife.com/atom.xml, here) are not rendered correctly.

This seems to be related to multibyte/unibyte buffer.  Here is a minimal
exemple to reproduce what I see:

--8<---------------cut here---------------start------------->8---
(defun my/gen-handle ()
  (with-current-buffer (get-buffer-create " foo")
    (erase-buffer)
    (insert "’…")
    (list (current-buffer) '("text/html"))))

(defun my/test ()
  (let ((handle (my/gen-handle)))
    (mm-with-part handle
      (buffer-string))))
--8<---------------cut here---------------end--------------->8---

When evaluating (my/test), see that the buffer string content does not
have the correct characters.

I get the behaviour I wanted with the attached patch but I don't know if
this is the way to handle this.

In GNU Emacs 31.0.50 (build 36, x86_64-unknown-openbsd7.7) of 2025-09-03
 built on computer
Repository revision: 6762ffca6b387df73b62db1adcec127317328604
Repository branch: mgi/mm-multibyte-wip
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: OpenBSD computer 7.7 GENERIC.MP#10 amd64

Configured using:
 'configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
 MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=no
 --with-toolkit-scroll-bars=no --without-cairo --without-dbus
 --without-gconf --without-gsettings --without-compress-install'

[0001-WIP-Fix-mm-multibyte.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

This bug report was last modified today.

Previous Next


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