Fix UTF-8 issue in Python 2 and 3