avoid failed encodings / stop bad charsets early