diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php index 1e8d7b8b73..78ccbe36f9 100644 --- a/lib/Model/IMAPMessage.php +++ b/lib/Model/IMAPMessage.php @@ -658,7 +658,11 @@ private function loadBodyData(Horde_Mime_Part $p, $partNo): string { // data is utf-8 by default. $charset = $p->getContentTypeParameter('charset'); if ($charset !== null && strtoupper($charset) !== 'UTF-8') { - $data = mb_convert_encoding($data, 'UTF-8', $charset); + try { + $data = mb_convert_encoding($data, 'UTF-8', $charset); + } catch (\Throwable $ex) { + $data = iconv($charset, 'UTF-8//TRANSLIT', $data); + } } return (string)$data; }