#15237: Django generated Atom/RSS feeds don't specify charset=utf8 in their
Content-Type
-------------------------------------+-------------------------------------
Reporter: simon | Owner: jasonkotenko
Status: closed | Milestone: 1.3
Component: | Version: 1.2
contrib.syndication | Keywords:
Resolution: fixed | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Comment (by caioariede):
Another workaround for this issue, is extending feed class:
{{{
from django.contrib.syndication.views import Feed
from django.utils import feedgenerator
class FeedUTF8(feedgenerator.DefaultFeed):
def __init__(self, *args, **kwargs):
super(FeedUTF8, self).__init__(*args, **kwargs)
self.mime_type = '%s; charset=utf-8' % self.mime_type
}}}
And then specify the feed_type:
{{{
class LatestEntriesFeed(Feed):
...
feed_type = FeedUTF8
}}}
...
{{{
$ curl -I http://localhost:8000/feed
HTTP/1.0 200 OK
Date: Thu, 31 Mar 2011 16:40:26 GMT
Server: WSGIServer/0.1 Python/2.6.1
Content-Type: application/rss+xml; charset=utf-8
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15237#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.