"Stephen J. Turnbull" <stephen(a)xemacs.org> writes:
>>>>> "Simon" == Simon Josefsson
<jas(a)extundo.com> writes:
Simon> Doing substantial work on mail-extr.el does not seem like a
Simon> good idea to me, but I guess it could be added if someone
Simon> do spend the time working on it...
Um, what is the canonical way to do mail-extr.el-like stuff then?
Do you mean how to use it? Like I said, call it with ASCII only
strings. mail-extr.el seems to have been designed for parsing name
and addressess from RFC 822 headers (see the first line of the file,
for instance), and mail headers are ASCII only. I guess the problems
comes when it is used in non-RFC822 situations, where the full mail
address includes non-ASCII, but mail-extr.el was not designed to be
used for that from what I can tell, and it does a poor job of it in
practice too (demonstrated by the buggy snippet in this thread).
As for implementing this properly, I think it would be nice to have a
higher-level API that handled mail addresses with non-ASCII content.
Perhaps this new API should even replace the current
`mail-extract-address-components' entry point. Of course, that effect
could be simulated by enhancing the current mail-extr.el but looking
at the code I doubt it will be a pleasant experience.
(Another rant is that mail-extr.el doesn't implement a correct
RFC(2)822 parser, but rather a heuristic parser improved over time.
In fact, emacs doesn't have a correct RFC 2822 parser anywhere, which
is a shame.)