repair encoding type when done