Replaced len() so it works with multibyte chars.