Answers for "UnicodeEncodeError: 'latin-1' codec can't encode characters in position 29-40:"

1

UnicodeEncodeError: 'latin-1' codec can't encode character 'u2013' in position 83: ordinal not in range(256)

>>> u'He said u201CHellou201D'.encode('iso-8859-1')
UnicodeEncodeError
>>> u'He said u201CHellou201D'.encode('cp1252')
'He said x93Hellox94'
Posted by: Guest on July-09-2021

Code answers related to "UnicodeEncodeError: 'latin-1' codec can't encode characters in position 29-40:"

Python Answers by Framework

Browse Popular Code Answers by Language