Subject: Re: bug#30405: 26.0.91; Incorrect apostrophe translation in ImageMagick error message

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 Feb 2018 10:02:26 +0200

> From: Glenn Morris <[email-masked]>
> Date: Fri, 09 Feb 2018 19:29:03 -0500
> Cc: Paul Eggert <[email-masked]>, [email-masked]
> 
> Maybe a better example is:
> 
> (defun foo ()
>   (interactive)
>   (error "can't"))
> (set-buffer-multibyte nil)
> M-x foo

I applied (the obvious) band-aid to image.el, so it no longer shows a
garbled error message.

The more general issue should be fixed on master, as it's too late to
make such changes on the release branch.  Note also that
substitute-command-keys is affected as well, as can be seen by
evaluating the following:

  (progn
    (set-buffer-multibyte nil)
    (substitute-command-keys "can't"))

Basically, anything that produces non-ASCII characters and then shows
that in the echo area while the current buffer is unibyte will hit
this problem.  While Lisp programs that produce literal strings can be
told to take care of that when they use unibyte buffers, the cases
discussed in this bug report happen because we convert ASCII strings
to non-ASCII strings under the hood, so the Lisp programs cannot be
held accountable.