From 98216df23b335b7c2efc0792d576aa2c7dc08f8a Mon Sep 17 00:00:00 2001 From: Aleksandr Solodov Date: Thu, 26 Jun 2025 16:36:18 +0300 Subject: [PATCH] method decodeStringFromUtf7ImapToUtf8() returns UTF-8 instead of ISO-8859-1 --- src/PhpImap/Mailbox.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index 02a3dad9..5edc91c2 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -510,7 +510,7 @@ public function encodeStringToUtf7Imap(string $str): string */ public function decodeStringFromUtf7ImapToUtf8(string $str): string { - $out = imap_utf7_decode($str); + $out = mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP'); if (!\is_string($out)) { throw new UnexpectedValueException('mb_convert_encoding($str, \'UTF-8\', \'UTF7-IMAP\') could not convert $str');