From 7d5a085294231bb53622a3d2dbe783b0d3d17f7a Mon Sep 17 00:00:00 2001 From: winet Date: Tue, 12 Mar 2024 19:15:13 +1000 Subject: [PATCH] Explicit charset? when returning csv --- app/blueprints/api/collections/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/blueprints/api/collections/routes.py b/app/blueprints/api/collections/routes.py index 3581276..6df04b3 100644 --- a/app/blueprints/api/collections/routes.py +++ b/app/blueprints/api/collections/routes.py @@ -63,4 +63,4 @@ def export_users_to_csv(id: int): writer.writeheader() writer.writerows(map(lambda user: user.to_dict(), collection.users)) - return si.getvalue(), 200, {'Content-Disposition': f'attachment; filename={filename}', 'Content-type': 'text/csv'} \ No newline at end of file + return si, 200, {'Content-Disposition': f'attachment; filename={filename}', 'Content-type': 'text/csv; charset=utf-8'} \ No newline at end of file