Proper unicode string handling for python 3