solve the encoding