From 55bd4e0052b830256ad1d1134bbe5c7231d1427b Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 12 Dec 2022 16:55:47 +0100 Subject: Add and use it::utf8_decode and it::utf8_encode for easier migration to PHP 8.2 --- it_xml.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_xml.class') diff --git a/it_xml.class b/it_xml.class index 62b4df5..7765054 100644 --- a/it_xml.class +++ b/it_xml.class @@ -141,7 +141,7 @@ function _sanitize($xmldata, $isutf8 = null) # Encode non-utf8 characters in a string, leave utf8 alone static function _utf8_fix($str) { - return preg_match('/^([\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]|[\xf0-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf])$/', $str) ? $str : utf8_encode($str); + return preg_match('/^([\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]|[\xf0-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf])$/', $str) ? $str : it::utf8_encode($str); } function consume(/* $p */) -- cgit v1.2.3