solve the encoding problem