Subject: bug#38955: 27.0.50; message-send-mail fails on non-printable characters in header

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 20 Aug 2020 16:39:08 +0200

Pieter van Oostrum <[email-masked]> writes:

> 1) Reply to the attached email message in gnus.
> 2) Send the message (C-c C-c)
>
> Emacs gives an error
> cl--assertion-failed: Assertion failed: (save-excursion (goto-char (point-min)) (not (re-search-forward "[^.-ÿ]" nil t)))
> which isn't helpful at all.

[...]

> The error is caused by a header with unprintable characters. The raw header is:
> To: =?iso-8859-1?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson
>  <[email-masked]>
> which translates to unprintable characters.

[...]

> I propose that the same choice is given to the user when these
> characters appear in the header. This means the test should also be
> done in message-fix-before-sending().

I've now done this in Emacs 28.

> Another suggestion: Can an additional choice be given to replace the
> offending characters with an escaped representation, for example url
> encoding?

Yeah, that makes sense.  Perhaps URL encoding is the most widely
understood (i.e., %hex for the byte).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no