We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15f9055 commit 471eb91Copy full SHA for 471eb91
src/IMAP/Message.php
@@ -502,10 +502,14 @@ private function decodeString($string, $encoding) {
502
* @return mixed|string
503
*/
504
private function convertEncoding($str, $from = "ISO-8859-2", $to = "UTF-8") {
505
- if (!$from) {
506
- return mb_convert_encoding($str, $to);
+ if (function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') {
+ return iconv($from, $to, $str);
507
+ } else {
508
+ if (! $from) {
509
+ return mb_convert_encoding($str, $to);
510
+ }
511
+ return mb_convert_encoding($str, $to, $from);
512
}
- return mb_convert_encoding($str, $to, $from);
513
514
515
/**
0 commit comments