unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: 36852@debbugs.gnu.org
Subject: bug#36852: 27.0.50; ietf-drums-parse-address doesn't handle non-ascii properly
Date: Tue, 30 Jul 2019 11:53:36 +0200	[thread overview]
Message-ID: <m2d0hrhmqn.fsf@gmail.com> (raw)
In-Reply-To: <871ry7g9ve.fsf@gmail.com> ("Štěpán Němec"'s message of "Tue, 30 Jul 2019 11:16:53 +0200")

>>>>> On Tue, 30 Jul 2019 11:16:53 +0200, Štěpán Němec <stepnem@gmail.com> said:

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

    Štěpán>   (mail-header-parse-address
    Štěpán>    (decode-coding-string "Áaááá Ůůůůů <aaa@example.net>" 'utf-8))

    Štěpán>   ;;=> ("aaa@example.net" . "aááá")

    Štěpán> It actually only cares about the first char of a word:

    Štěpán>   (let ((ietf-drums-atext-token "-ÁŮ^a-zA-Z0-9!#$%&'*+/=?_`{|}~"))
    Štěpán>     (mail-header-parse-address
    Štěpán>      (decode-coding-string "Áaááá Ůůůůů <aaa@example.net>" 'utf-8)))

    Štěpán>   ;;=> ("aaa@example.net" . "Áaááá Ůůůůů")

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

Mail headers are defined to be ascii-only, although as Iʼve just
discovered, gmail undoes Gnus' perfectly formatted RFC 2047 encoding
and replaces it with UTF-8 characters. Bad Google, bad.

Perhaps mail-header-parse-address could just discard the complete
display string if it finds a non-ascii char? That would at least
prevent it from propagating.

Robert





  reply	other threads:[~2019-07-30  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30  9:16 bug#36852: 27.0.50; ietf-drums-parse-address doesn't handle non-ascii properly Štěpán Němec
2019-07-30  9:53 ` Robert Pluim [this message]
2019-09-15 12:00 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d0hrhmqn.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=36852@debbugs.gnu.org \
    --cc=stepnem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).