utf8_en/decode deprecation
amazeika opened this issue · 0 comments
amazeika commented
These two functions are deprecated on PHP 8.2 and going to be removed on PHP 9.
We need to replace these.
Solution
Encode
mb_convert_encoding($string, "UTF-8", mb_detect_encoding($string))
Decode
mb_convert_encoding($string, "ISO-8859-1", "UTF-8")
source: https://stackoverflow.com/questions/74865684/php-utf8-en-decode-deprecated-what-can-i-use
Implementation
Make use of https://github.com/joomlatools/joomlatools-framework/blob/master/code/libraries/joomlatools/library/legacy.php for re-defining the functions when removed.