My website has been running for a long time. Currently upgraded to php 5.6 and maria db 10.1.44. The utf8_encode function was used in a lot of php code. But now I have to remove it so the characters are output correctly. However, I can't edit a lot of php code ... Is there a way to invalidate the utf8_encode function? Or is it possible to override the php core function?
Asked
Active
Viewed 40 times
2 Answers
1
You could override utf8_encode() with function_override()
but I can not recommend it.
Instead, you better fix the existing code yourself. When you use an IDE like Eclipse PDT, you can do a global search in all files and folders, and remove the calls to utf8_encode()
rather quickly.
While PHP 5.6's default encoding has been changed to UTF-8, that version is already end-of-life: https://www.php.net/supported-versions.php. After moving up to 5.6, consider migrating your code to PHP 7.2 at least.

Code4R7
- 2,600
- 1
- 19
- 42