From c9727a2bbbefa2df66542f3b042d0c6820f6c931 Mon Sep 17 00:00:00 2001 From: reciproco Date: Sun, 8 May 2016 22:18:12 +0200 Subject: [PATCH] Fix CRI-57 Bug Fix error in instructor dashboard, data download section, when trying to download a csv with the issued certificates in a spanish (es-419) configured edx-platform deployment returns a UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 16: ordinal not in range(128) --- lms/djangoapps/instructor_analytics/csvs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/instructor_analytics/csvs.py b/lms/djangoapps/instructor_analytics/csvs.py index e2c34041df..c03a6b7456 100644 --- a/lms/djangoapps/instructor_analytics/csvs.py +++ b/lms/djangoapps/instructor_analytics/csvs.py @@ -24,7 +24,9 @@ def create_csv_response(filename, header, datarows): quotechar='"', quoting=csv.QUOTE_ALL) - csvwriter.writerow(header) + encoded_header = [unicode(s).encode('utf-8') for s in header] + csvwriter.writerow(encoded_header) + for datarow in datarows: encoded_row = [unicode(s).encode('utf-8') for s in datarow] csvwriter.writerow(encoded_row)