Skip to content

Commit

Permalink
Remove usage of deprecated uft8_decode/encode
Browse files Browse the repository at this point in the history
  • Loading branch information
paranoiq committed Sep 29, 2022
1 parent 36a88a4 commit 1fd6583
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/common/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.');
}
Expand Down

0 comments on commit 1fd6583

Please sign in to comment.