diff --git a/api/src/Translation.php b/api/src/Translation.php index 9fefc4f2d1..961177f7aa 100644 --- a/api/src/Translation.php +++ b/api/src/Translation.php @@ -947,9 +947,14 @@ class Translation { return utf8_decode($data); } - if (self::$mbstring && !$prefer_iconv && ($data = @mb_convert_encoding($data,$to,$from)) != '') - { - return $data; + try { + if (self::$mbstring && !$prefer_iconv && ($data = @mb_convert_encoding($data, $to, $from)) != '') + { + return $data; + } + } + catch (\ValueError $e) { + // ignore encodings unknown to mb_convert_encoding } if (function_exists('iconv')) {