Subject: bug#37580: 26.3; setting buffer as unibyte temporarily may change buffer contents

From: Eli Zaretskii <[email-masked]>
Date: Wed, 02 Oct 2019 18:14:43 +0300

> From: [email-masked]
> Date: Wed, 02 Oct 2019 18:43:45 +0900
> 
> 
> If a multibyte buffer contains eight-bit character sequences,
> evaluating the form
>  (progn (set-buffer-multibyte nil) (set-buffer-multibyte t))
> may convert them to multibyte characters.
> 
> Afterwards, buffer-undo-list may be inappropriate.
> Undo in the form below changes the position of character '1'.

I don't think this is a bug.  Changing the multibyte-ness of a buffer
really does change the contents.  You should only do that where it
makes sense.