Use mb_substr if it exists, fallback to substr otherwise.