Yet another solution for encoding problem.