diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php old mode 100755 new mode 100644 index dc76535..27c3dc8 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -597,6 +597,10 @@ class Message return $converted; } + if ($to === 'utf-8') { + return UTF8::fix($text); + } + return null; } diff --git a/tests/Fetch/Test/MIMETest.php b/tests/Fetch/Test/MIMETest.php index 3fc8c26..1685f5c 100644 --- a/tests/Fetch/Test/MIMETest.php +++ b/tests/Fetch/Test/MIMETest.php @@ -34,6 +34,10 @@ class MIMETest extends \PHPUnit_Framework_TestCase . PHP_EOL . '=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=' ), + array( + 'ab11 ? ?????.jpg', + "\x61\x62\x31\x31\x20\x97\x20\x3f\x3f\x3f\x3f\x3f\x2e\x6a\x70\x67", + ), array( '?????? ?????.pdf', '=?UTF-8?B?' .base64_encode("\xCF\xF0\xE8\xEC\xE5\xF0 \xEF\xEB\xE0\xED\xE0\x2E\x70\x64\x66") . '?=',