replace deprecated function utf8_encode (#1198)
utf8_encode is deprecated since PHP 8.2.0
This commit is contained in:
@@ -64,7 +64,7 @@ class IdnaWrapper
|
|||||||
*/
|
*/
|
||||||
public function encode(string $to_encode): string
|
public function encode(string $to_encode): string
|
||||||
{
|
{
|
||||||
$to_encode = $this->isUtf8($to_encode) ? $to_encode : utf8_encode($to_encode);
|
$to_encode = $this->isUtf8($to_encode) ? $to_encode : mb_convert_encoding($to_encode, 'UTF-8');
|
||||||
try {
|
try {
|
||||||
return $this->idna_converter->encode($to_encode);
|
return $this->idna_converter->encode($to_encode);
|
||||||
} catch (InvalidArgumentException $iae) {
|
} catch (InvalidArgumentException $iae) {
|
||||||
|
|||||||
Reference in New Issue
Block a user