mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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
|
public static function Utf7ModifiedToUtf8(string $sStr) : string
|
||||||
{
|
{
|
||||||
$sResult = \is_callable('imap_mutf7_to_utf8')
|
// imap_mutf7_to_utf8() is broken and doesn't support U+10000 and up,
|
||||||
? \imap_mutf7_to_utf8($sStr)
|
// thats why mmb_convert_encoding is used
|
||||||
// : \mb_convert_encoding($sStr, 'UTF-8', 'UTF7-IMAP');
|
$sResult = static::MbConvertEncoding($sStr, 'UTF7-IMAP', 'UTF-8');
|
||||||
: static::MbConvertEncoding($sStr, 'UTF7-IMAP', 'UTF-8');
|
|
||||||
// ucnv U_FILE_ACCESS_ERROR
|
// ucnv U_FILE_ACCESS_ERROR
|
||||||
// $sResult = \UConverter::transcode($sStr, \UConverter::UTF8, \UConverter::IMAP_MAILBOX, ['to_subst' => '<27>']);
|
// $sResult = \UConverter::transcode($sStr, \UConverter::UTF8, \UConverter::IMAP_MAILBOX, ['to_subst' => '<27>']);
|
||||||
return (false === $sResult) ? $sStr : $sResult;
|
return (false === $sResult) ? $sStr : $sResult;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue