Encode string to UTF-8 in Python