Fix potential encoding problems