diff options
| author | Paul McMillan <Paul@McMillan.ws> | 2012-02-10 23:45:22 +0000 |
|---|---|---|
| committer | Paul McMillan <Paul@McMillan.ws> | 2012-02-10 23:45:22 +0000 |
| commit | 114b655247243d553131b508111d173c3c1181ff (patch) | |
| tree | 8e43efd1741f986b2b4fd84f773e7310c7715160 | |
| parent | 0ce6636102d9e1c8c158c0e3eadb5a5db6b06a71 (diff) | |
Fixed #15237 (again). RSS feeds now include proper character encoding in the mimetype. Thanks shadow for the report and Michal Rzechonek for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/feedgenerator.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/utils/feedgenerator.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index df3cf41652..592d787200 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -200,7 +200,7 @@ class Enclosure(object): self.url = iri_to_uri(url) class RssFeed(SyndicationFeed): - mime_type = 'application/rss+xml' + mime_type = 'application/rss+xml; charset=utf-8' def write(self, outfile, encoding): handler = SimplerXMLGenerator(outfile, encoding) handler.startDocument() diff --git a/tests/regressiontests/utils/feedgenerator.py b/tests/regressiontests/utils/feedgenerator.py index 6b85abf89c..3990896f12 100644 --- a/tests/regressiontests/utils/feedgenerator.py +++ b/tests/regressiontests/utils/feedgenerator.py @@ -87,6 +87,15 @@ class FeedgeneratorTest(unittest.TestCase): atom_feed.mime_type, "application/atom+xml; charset=utf-8" ) + def test_rss_mime_type(self): + """ + Test to make sure RSS MIME type has UTF8 Charset parameter set + """ + rss_feed = feedgenerator.Rss201rev2Feed("title", "link", "description") + self.assertEqual( + rss_feed.mime_type, "application/rss+xml; charset=utf-8" + ) + # Two regression tests for #14202 def test_feed_without_feed_url_gets_rendered_without_atom_link(self): |
