Commit 1cdcc66d authored by ibuler's avatar ibuler

[Update] 修改excel打开乱码

parent aa25b774
......@@ -53,7 +53,6 @@ class JMSCSVRender(BaseRenderer):
def render(self, data, media_type=None, renderer_context=None):
renderer_context = renderer_context or {}
encoding = renderer_context.get('encoding', 'utf-8')
request = renderer_context['request']
template = request.query_params.get('template', 'export')
view = renderer_context['view']
......@@ -74,7 +73,7 @@ class JMSCSVRender(BaseRenderer):
table = self._gen_table(data, header, labels)
csv_buffer = BytesIO()
csv_writer = unicodecsv.writer(csv_buffer, encoding=encoding)
csv_writer = unicodecsv.writer(csv_buffer, encoding='utf-8-sig')
for row in table:
csv_writer.writerow(row)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment