Handle the encoding problems.