Fix UnicodeEncodeError exception in name_parser