Python3 compatibility + UTF8 string encoding