From 1fd6583381ae95edcbd20d71331b5985aec14bea Mon Sep 17 00:00:00 2001 From: paranoiq Date: Thu, 29 Sep 2022 18:43:38 +0200 Subject: [PATCH] Remove usage of deprecated uft8_decode/encode --- src/common/Str.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/common/Str.php b/src/common/Str.php index 4a928d83..7bf29833 100644 --- a/src/common/Str.php +++ b/src/common/Str.php @@ -53,8 +53,6 @@ use function strrpos; use function strtolower; use function substr; -use function utf8_decode; -use function utf8_encode; /** * UTF-8 strings manipulation @@ -884,10 +882,6 @@ public static function convertEncoding(string $string, string $from, string $to) } catch (Error $e) { throw new ErrorException('Cannot convert encoding', null, $e); } - } elseif ($from === Encoding::ISO_8859_1 && $to === Encoding::UTF_8 && function_exists('utf8_encode')) { - return utf8_encode($string); - } elseif ($from === Encoding::UTF_8 && $to === Encoding::ISO_8859_1 && function_exists('utf8_decode')) { - return utf8_decode($string); } else { throw new ShouldNotHappenException('No extension for converting encodings installed.'); }