Fix a UnicodeEncodeError.