--- ./mime.php.orig Mon Mar 28 19:59:41 2005 +++ ./mime.php Thu Apr 28 13:11:45 2005 @@ -670,7 +670,22 @@ */ function _encodeHeaders($input) { + foreach ($input as $hdr_name => $hdr_value) { + + if ( strtoupper($hdr_name) == 'SUBJECT' ) { + $replacement = preg_replace('/([\x80-\xFF])/e', + '"=" . + strtoupper(dechex(ord("\1")))', + $hdr_value); + $hdr_value = str_replace($hdr_value, '=?' . + $this->_build_params['head_charset'] . + '?Q?' . $replacement . '?=', + $hdr_value); + $input[$hdr_name] = $hdr_value; + continue; + } + preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches); foreach ($matches[1] as $value) { $replacement = preg_replace('/([\x80-\xFF])/e',