Better sanitization of invalid Unicode values