Now encode_mimeheader() only encodes the header if it isn't 100% ASCII.

This commit is contained in:
stronk7
2006-03-19 02:38:21 +00:00
parent 56a2b987e6
commit c539d6224b
+4
View File
@@ -193,6 +193,10 @@ class textlib {
* paravoid (http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283).
*/
function encode_mimeheader($text, $charset='utf-8') {
/// If the text is pure ASCII, we don't need to encode it
if ($this->convert($text, $charset, 'ascii') == $text) {
return $text;
}
/// Although RFC says that line feed should be \r\n, it seems that
/// some mailers double convert \r, so we are going to use \n alone
$linefeed="\n";