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
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