Fix a character encoding crash