ZF-2684: Zend_Mail wrong encode of mail subject, if it contain underscore


I cannot decode mail subject in Japanese at OutlookExpress and Gmail. I think encoding for '_' (underscore) is wrong.

function _encodeHeader() $quotedValue = str_replace(array('?', ' '), array('=3F', '=20'), $quotedValue);

fix like this $quotedValue = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $quotedValue);

I check correctly at OE and Gmail.

thank you

(Ref) The "Q" encoding defined in RFC2047 4.2.2 The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" (underscore, ASCII 95.). (This character may not pass through some internetwork mail gateways, but its use will greatly enhance readability of "Q" encoded data with mail readers that do not support this encoding.) Note that the "_" always represents hexadecimal 20, even if the SPACE character occupies a different code position in the character set in use.


Thank you for report. Fixed in SVN r9222