Do the encode-decode hack only on python 3, on python 2 decode as utf-8