Fix all non utf8 strings

This commit is contained in:
Sergey Linnik 2017-03-07 18:13:26 +03:00
parent 82d18754bc
commit 366c5dc189
2 changed files with 8 additions and 0 deletions

4
src/Fetch/Message.php Executable file → Normal file
View File

@ -597,6 +597,10 @@ class Message
return $converted; return $converted;
} }
if ($to === 'utf-8') {
return UTF8::fix($text);
}
return null; return null;
} }

View File

@ -34,6 +34,10 @@ class MIMETest extends \PHPUnit_Framework_TestCase
. PHP_EOL . . PHP_EOL .
'=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=' '=?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( array(
'?????? ?????.pdf', '?????? ?????.pdf',
'=?UTF-8?B?' .base64_encode("\xCF\xF0\xE8\xEC\xE5\xF0 \xEF\xEB\xE0\xED\xE0\x2E\x70\x64\x66") . '?=', '=?UTF-8?B?' .base64_encode("\xCF\xF0\xE8\xEC\xE5\xF0 \xEF\xEB\xE0\xED\xE0\x2E\x70\x64\x66") . '?=',