fix python 2 to 3 encoding compatiblity issue