Solving the encoding problem