PHP Warning: htmlspecialchars(): Invalid multibyte

Hello any idea what could with these errors in logs ? shop has just english language the exactly error is



PHP Warning: htmlspecialchars(): Invalid multibyte sequence in argument in /var/www/vhosts/tomtomrepairteam.co.uk/httpdocs/prepare.php on line 183





$data[$k] = ($revert == false) ? htmlspecialchars($sub, ENT_QUOTES, 'UTF-8') : htmlspecialchars_decode($sub, ENT_QUOTES);







Thanks a lot

Hi,



I had same problem (with other language).

Results in my shop:

Funny characters in 2-3 blocks, slow response and “Resource limit is reached” message.



I changed php version 5.3 to 5.4 and the error.log is clear now (only php_notice rows).



But here is some links, these might help you:

php - htmlspecialchars(): Invalid multibyte sequence in argument - Stack Overflow

Andy’s Blog