correct the encoding