GNU bug report logs - #75415
31.0.50; quoted-printable-en/decode-region doesn't preserve end markers

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Tue, 7 Jan 2025 04:25:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 75415 <at> debbugs.gnu.org
Cc: monnier <at> iro.umontreal.ca
Subject: bug#75415: 31.0.50; quoted-printable-en/decode-region doesn't preserve end markers
Date: Mon, 06 Jan 2025 23:24:15 -0500
Package: Emacs
Version: 31.0.50


In a fresh Emacs try:

       (with-temp-buffer
         (set-buffer-multibyte nil)
         (insert "\300\300")
         (encode-coding-region (point-min) (point) 'utf-8)
         (quoted-printable-encode-region (point-min) (point))
         (insert "!!")
         (buffer-string))

It will likely return "=C0!!=C0" whereas it should return "=C0=C0!!".

Found via a bug in VM: https://gitlab.com/emacs-vm/vm/-/issues/491

The same problem plagues `quoted-printable-decode-region`.

I think we really need to introduce a `replace-region` primitive which
takes care of preserving the position of markers instead of having to teach
ELisp coders the delicate art of combining `insert(-before-markers)` and
`delete` to best preserve markers.


        Stefan





This bug report was last modified 184 days ago.

Previous Next


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