diff --git a/src/utils/utf8.php b/src/utils/utf8.php --- a/src/utils/utf8.php +++ b/src/utils/utf8.php @@ -712,7 +712,16 @@ 'mbstring')); } - $result = @mb_convert_encoding($string, $to_encoding, $from_encoding); + try { + $result = @mb_convert_encoding($string, $to_encoding, $from_encoding); + } catch (ValueError $ex) { + throw new Exception( + pht( + "String conversion from encoding '%s' to encoding '%s' failed: %s", + $from_encoding, + $to_encoding, + $ex)); + } if ($result === false) { $message = error_get_last();