These past few days I\'ve been working toward converting my PHP code base from latin1 to UTF-8. I\'ve read the two main solutions are to either replace the single byte funct
You can use this http://php.net/manual/en/mbstring.overload.php setting in php.ini file, so you don't need to change you code.
But be careful, because not all string function will be automatically changed. This is one: http://php.net/manual/en/function.substr-replace.php
As soon as you're examining or modifying a multibyte string, you need to use a mb_* function. A very quick example which demonstrates why:
$str = "abcžđščćöçefg";
mb_internal_encoding("UTF-8");
echo "strlen: ".strlen($str)."\n";
echo "mb_strlen: ".mb_strlen($str)."\n";
This prints out:
strlen: 20
mb_strlen: 13