mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Bugfix: imap_mutf7_to_utf8 is broken for U+10000 and up
This commit is contained in:
parent
13492a9d0b
commit
fc2958538c
1 changed files with 3 additions and 4 deletions
|
@ -1063,10 +1063,9 @@ abstract class Utils
|
|||
|
||||
public static function Utf7ModifiedToUtf8(string $sStr) : string
|
||||
{
|
||||
$sResult = \is_callable('imap_mutf7_to_utf8')
|
||||
? \imap_mutf7_to_utf8($sStr)
|
||||
// : \mb_convert_encoding($sStr, 'UTF-8', 'UTF7-IMAP');
|
||||
: static::MbConvertEncoding($sStr, 'UTF7-IMAP', 'UTF-8');
|
||||
// imap_mutf7_to_utf8() is broken and doesn't support U+10000 and up,
|
||||
// thats why mmb_convert_encoding is used
|
||||
$sResult = static::MbConvertEncoding($sStr, 'UTF7-IMAP', 'UTF-8');
|
||||
// ucnv U_FILE_ACCESS_ERROR
|
||||
// $sResult = \UConverter::transcode($sStr, \UConverter::UTF8, \UConverter::IMAP_MAILBOX, ['to_subst' => '<27>']);
|
||||
return (false === $sResult) ? $sStr : $sResult;
|
||||
|
|
Loading…
Reference in a new issue