validate utf-8 string