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

后端 未结 2 1567
自闭症患者
自闭症患者 2021-01-12 16:06

I\'m trying to import to cvs, but I get this error

UnicodeEncodeError at /brokers/csv/\'ascii\' codec can\'t encode character u\'\\u2013\' in position 9: or         


        
2条回答
  •  孤街浪徒
    2021-01-12 16:46

    Are you using lib cStringIO? I ran into a similar problem after replacing StringIO with cStringIO. Going back to StringIO was the solution.

    Furthermore, you can try using

    from __future__ import unicode_literals
    

    as the first line of your code.

提交回复
热议问题