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

后端 未结 2 1569
自闭症患者
自闭症患者 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:50

    I'm guessing your using python 2.x?

    if so try using .encode('utf-8') on your string when writing.

提交回复
热议问题