Subject: bug#36852: 27.0.50; ietf-drums-parse-address doesn't handle non-ascii properly

From: Štěpán Němec <[email-masked]>
Date: Tue, 30 Jul 2019 11:16:53 +0200

ietf-drums-parse-address (AKA mail-header-parse-address) uses
ietf-drums-atext-token to parse display-name, but the regexp range only
contains ASCII characters, so e.g. as used in debbugs-gnu-show-reports,
the following happens:

  (mail-header-parse-address
   (decode-coding-string "Áaááá Ůůůůů <[email-masked]>" 'utf-8))

  ;;=> ("[email-masked]" . "aááá")

It actually only cares about the first char of a word:

  (let ((ietf-drums-atext-token "-ÁŮ^a-zA-Z0-9!#$%&'*+/=?_`{|}~"))
    (mail-header-parse-address
     (decode-coding-string "Áaááá Ůůůůů <[email-masked]>" 'utf-8)))

  ;;=> ("[email-masked]" . "Áaááá Ůůůůů")

I'm not quite sure what the proper fix is, as the ASCII-only thing seems
to be intentional. Maybe it's just not supposed to be used the way it is
used in debbugs-gnu.el?