Clean output test file to handle non-UTF8 bytes (f**ing invalid XML characters)