Has anyone been able to write out UTF-8 characters using python's xlwt?

前端 未结 2 1133
庸人自扰
庸人自扰 2020-12-11 05:04

I\'m trying to write data to an excel file that includes Japanese characters. I\'m using codec.open() to get the data, and that seems to work fine, but I run into this error

2条回答
  •  没有蜡笔的小新
    2020-12-11 05:36

    As suggested by this question, setting the encoding on the WorkBook

    wb = xlwt.Workbook(encoding='latin-1') 
    

    should also resolve the issue (it worked for me).

提交回复
热议问题