utf-8 fixes for Python3