Switched to using mb_* functions available in all PHP 5 versions