Solving encoding problem