fix encode problem.