从django返回以BOM表以UTF-8编码的csv [英] Return a csv encoded in UTF-8 with BOM from django
本文介绍了从django返回以BOM表以UTF-8编码的csv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试输出用户可以使用excel打开的CSV文件.我已经用UTF-8编码了所有字符串,但是当我用excel打开文件时,我看到了颤动.仅在使用BOM将文件转换为UTF-8后(在Windows上使用notepad ++),我才能够正确显示内容.
I'm trying to output a CSV file that the user could open with excel. I've encoded all string in UTF-8 but when I opened the file with excel I see jibrish. Only after converting the file to UTF-8 with BOM (using notepad++ on windows) I was able to display the content properly.
查看全文