Sunday, June 23, 2019

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)

import sys  reload(sys)  sys.setdefaultencoding('utf8')

and then apply 
text1=text.decode('utf-8')

No comments:

Post a Comment