compatibility with unicode in python 2