fixed some spell error and add a function to validate utf8 string