Cope with broken encodings