Workaround for mb_strlen in PHP 5.3