fix bad encodings