On Tue, Apr 14, 2009 at 12:25 PM, Jesse <adles...@gmail.com> wrote:

>
> The error is 'ascii' codec can't encode character u'\xb0' in position
> 98: ordinal not in range(128) and it occurs when a temperature degree
> such as 35°C
> is in the text.
>
> I'm using the following code in the view.py:
>
>   response = HttpResponse(mimetype='text/csv')
>    response['Content-Disposition'] = 'attachment;
> filename=publication.csv'
>    writer = csv.writer(response)
>    writer.writerow(['Title', 'Authors', 'Year', 'Journal',
> 'Citation', 'Web Address'])
>    for publication in publication_list:
>        writer.writerow([publication.pubtitlestrip,
> publication.pubauthors, publication.year, publication.journal,
> publication.pubcitationnum, publication.pubwebaddress])
>    return response
>
> Is there someway to unicode the writer?
>
>
> >
>
Simon Willison(I think) wrote up a class that implements the same API but
handles unicode: http://www.djangosnippets.org/snippets/993/

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to