Fixed utf-8 handling in python 2.x