I want to export a CSV-file encoded in ASCII but the default is UTF-8 if I encode the strings i get the bytecode written in the csv (b'String')
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="datev_export.csv"'
writer = csv.writer(response, delimiter=";",)
row = ['some', 'strings']
writer.writerow(first_row)
return response
So how can I encode my string to ASCII without the leading b'' ?
b""
prefix, and the default encoding is ascii. Post the code and related data that produces the problem.