fix some encoding problem for py3