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)