Handle UnicodeEncodeError