Fixed encoding bug when building Python package on Python3/non-utf8 system