Write UTF-8 BOM into csv download file

This commit is contained in:
allegroai 2023-07-26 18:43:38 +03:00
parent 00552da1b0
commit 6885d07462

View File

@ -301,6 +301,7 @@ def download_for_get_all(call: APICall, company, request: DownloadForGetAllReque
with StringIO() as fp:
writer = csv.writer(fp)
if page == 1:
fp.write("\ufeff") # utf-8 signature
writer.writerow(field_mappings)
writer.writerows(get_projected_fields(r) for r in result)
yield fp.getvalue()