From d756b18443e48af5ca96061d1efc7a29aa13ec4b Mon Sep 17 00:00:00 2001 From: lgelauff <32471480+lgelauff@users.noreply.github.com> Date: Fri, 28 May 2021 23:10:59 -0700 Subject: [PATCH] adding BOM to csv export 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) --- montage/admin_endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montage/admin_endpoints.py b/montage/admin_endpoints.py index a46417d..213fd5d 100644 --- a/montage/admin_endpoints.py +++ b/montage/admin_endpoints.py @@ -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()