Fix encoding issue in python 3