UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)

后端 未结 6 1349
轻奢々
轻奢々 2020-11-30 22:50

I am parsing an xsl file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 23:34

    I had the same problem. This work fine for me:

    str(objdata).encode('utf-8')
    

提交回复
热议问题