Commit 602988c3 by Bertrand Marron

Fix unicode issue

parent c139c2a5
...@@ -68,7 +68,7 @@ class Command(BaseCommand): ...@@ -68,7 +68,7 @@ class Command(BaseCommand):
fp = open(fn, 'w') fp = open(fn, 'w')
writer = csv.writer(fp, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL) writer = csv.writer(fp, dialect='excel', quotechar='"', quoting=csv.QUOTE_ALL)
writer.writerow(datatable['header']) writer.writerow([unicode(s).encode('utf-8') for s in datatable['header']])
for datarow in datatable['data']: for datarow in datatable['data']:
encoded_row = [unicode(s).encode('utf-8') for s in datarow] encoded_row = [unicode(s).encode('utf-8') for s in datarow]
writer.writerow(encoded_row) writer.writerow(encoded_row)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment