Improve MIME header handling
Bug #266574 reported by
Loewis
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This patch fixes a number of problems for non-English
archives. In particular:
- it normalizes the encoding name (converting to
lower-case, splitting of potential \r characters, and
splitting off potential quotes)
- if the article and the header encoding differ, it tries
to preserve the decoded header as a Unicode string,
instead of immediately falling back to the MIME-encoded
one (if the encoding is not known to Python it will
still fall back)
- if a Unicode string needs to be formatted, it uses
character references for all non-ASCII characters.
[http://
To post a comment you must log in.
The second version of this patch expects and ignores
LookupError from unicode(), and it decodes the subjects from
the next and previous articles.