Comment 124 for bug 369150

Revision history for this message
In , Martin-wilck (martin-wilck) wrote :

Created an attachment (id=329874)
patch against CVS 20080716

Applies, compiles, and passes basic testing with today's code in HEAD.

As before, the rationale of this patch is to postpone RFC2047 decoding of "address list" type fields until after they are split into a real list. This prevents the misinterpretation of RFC2047-encoded special characters (most commonly, ","). With the patch, Thunderbird uses the *encoded* fields internally and does RFC2047 decoding basically just before displaying the values to the user.

This means that calls to MIME_DecodeMimeHeader() are now done at different parts of the code than before.

A small problem: MIME_DecodeMimeHeader() takes the "charset" and "charsetoverride" parameters. I didn't find it obvious how to set these correctly, given that I am now calling this function from a different stage as before. As I am not sure how charset overriding is supposed to work, I leave it up to others to decide.

The Fixme in the code for mimehdrs.cpp means that I am not 100% sure if additional headers should also be treated this way. Currently the patch postpones RFC2047 decoding for the "to", "from", "cc", "bcc", "reply-to", and "sender" headers.