From f1263303906518b5a93edb32aa25e3f1fcb540a5 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Mon, 4 Jul 2016 22:18:34 +1000 Subject: [PATCH] Handles unicode strings properly. --- symposion/reviews/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/symposion/reviews/views.py b/symposion/reviews/views.py index 349966b8..b6569de4 100644 --- a/symposion/reviews/views.py +++ b/symposion/reviews/views.py @@ -140,6 +140,11 @@ def review_all_proposals_csv(request): csv_line = [getattr(proposal, field) for field in fields] + # Enusre that unicode items are handled properly. + for i, item in enumerate(csv_line): + if isinstance(item, unicode): + csv_line[i] = item.encode("utf8") + writer.writerow(csv_line) return HttpResponse(output.getvalue(), "text/csv")