-
-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Hi,
Thank you for this package. We have stumbled upon some cases were we get fatal exceptions due to charset conversion errors. We fetch the RAW email from either the Gmail or Outlook API and pass that to the from() method:
$message = Message::from($rawEmailFromGmail);
Whenever we run $message->getHtmlContent() we sometimes run into conversion errors as seen in the issue subject:
ErrorException: iconv_strlen(): Wrong charset, conversion from3' to UCS-4LE' is not allowed in /var/www/trengoweb/envoyer/releases/20210805205144/vendor/zbateson/mb-wrapper/src/MbWrapper.php:397
It seems that 3 is not supported by iconv, but it is odd that it still tries to convert it. Is this a bug? And is wrapping getHtmlContent() in a try/catch block and retrying it with setCharsetOverride('UTF-8) a proper fix?
Thanks again!
Kind regards,
Marcel