burke-software / django-report-utils

Common functions used for reporting needs. Used by django-report-builder and django-report-scaffold.
Other
10 stars 27 forks source link

Export Unicode data to csv: UnicodeEncodeError #21

Open aprilmay opened 8 years ago

aprilmay commented 8 years ago

Unicode data in fields break the csv export with an UnicodeEncodeError exception (mixins.py line 92, in build_csv_response).

Validated a quick fix, that would require using the unicodecsv drop-in replacement for the standard csv module.

In mixins.py, just replace: import csv by import unicodecsv as csv

AMongeMoreno commented 8 years ago

I found another solution for this bug, it just require using the smart_str function provided by django in lines 98 and 148. It is still open, btw