diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 4afb07a..87354bd 100644 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -599,11 +599,18 @@ class Message } $converted = null; - if (!$converted && function_exists('mb_convert_encoding') && @mb_check_encoding($text, $from)) { - $converted = @mb_convert_encoding($text, $to, $from); + if (!$converted && function_exists('mb_convert_encoding')) { + try { + if (mb_check_encoding($text, $from)) { + $converted = mb_convert_encoding($text, $to, $from); + } + } catch (\ValueError $e) { + // noop + } } if (!$converted && function_exists('iconv')) { + // Для `iconv` @ пока работает $converted = @iconv($from, $to . self::$charsetFlag, $text); }