ZF2-364: Zend\Mail\Header::mimeEncodeValue unnecessarily encodes pure-ASCII headers
Description
In contrast to ZF1, ZF2 unnecessarily encodes headers even if they contain only ASCII characters. Demo:
$mail = new Zend\Mail\Message(); $mail->setEncoding('UTF-8'); $mail->setFrom('example@example.org', 'My Name'); echo $mail->toString();
Result:
From: =?UTF-8?Q?My=20Name?= example@example.org
Expected result:
From: My Name example@example.org
Comments
Posted by Steffen Weber (steffen) on 2012-06-17T12:19:14.000+0000
I think the method Zend\Mime\Mime::isPrintable can be used to determine if a header has to be encoded.
Posted by Maks 3w (maks3w) on 2012-06-18T14:38:08.000+0000
As workaround you can do one of the following options:
Posted by Steffen Weber (steffen) on 2012-07-07T10:48:28.000+0000
I've just downloaded ZF2 Beta 5. Even the "Date" header is encoded. Maybe some classes like Zend\Mail\Header\Date should just ignore calls of their "setEncoding" method?
Posted by Ralph Schindler (ralph) on 2012-10-08T20:15:12.000+0000
This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2492