From f08630cde9250c63af7a47522c4bca431a593ecc Mon Sep 17 00:00:00 2001 From: Alex Kavon Date: Thu, 12 Jun 2014 13:51:27 -0600 Subject: [PATCH] Switch to mb_convert_encoding Changing from iconv to mb_convert_encoding. $charset = 'UTF-8//TRANSLIT' is no longer needed. 'UTF-8' set as default and user may change value to whatever they wish :) --- src/Fetch/Message.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 537b0ea..76f6c6d 100644 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -167,7 +167,7 @@ class Message * * @var string */ - public static $charset = 'UTF-8//TRANSLIT'; + public static $charset = 'UTF-8'; /** * This constructor takes in the uid for the message and the Imap class representing the mailbox the @@ -437,8 +437,8 @@ class Message $messageBody = self::decode($messageBody, $structure->encoding); - if (!empty($parameters['charset']) && !preg_match('/utf-?8/i', $parameters['charset']) && $parameters['charset'] !== self::$charset) - $messageBody = iconv($parameters['charset'], self::$charset, $messageBody); + if (!empty($parameters['charset']) && $parameters['charset'] !== self::$charset) + $messageBody = mb_convert_encoding($messageBody, self::$charset, $parameters['charset']); if (strtolower($structure->subtype) === 'plain' || ($structure->type == 1 && strtolower($structure->subtype) !== 'alternative')) { if (isset($this->plaintextMessage)) {