Skip to content

Commit

Permalink
adding BOM to csv export
Browse files Browse the repository at this point in the history
Should resolve #130 . Haven't been able to test locally though, so please tread with caution. Reusing from [example here](https://www.programcreek.com/python/example/98129/unicodecsv.DictWriter)
  • Loading branch information
lgelauff committed May 29, 2021
1 parent fe5dc80 commit d756b18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion montage/admin_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def download_round_entries_csv(user_dao, round_id):
output_name = 'montage_entries-%s.csv' % slugify(rnd.name, ascii=True)
output = io.BytesIO()
csv_fieldnames = sorted(entry_infos[0].keys())
csv_writer = unicodecsv.DictWriter(output, fieldnames=csv_fieldnames)
csv_writer = unicodecsv.DictWriter(output, fieldnames=csv_fieldnames, encoding='utf-8-sig')
csv_writer.writeheader()
csv_writer.writerows(entry_infos)
ret = output.getvalue()
Expand Down

0 comments on commit d756b18

Please sign in to comment.