|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73205 - website/public_html/beta/site-tools/boost_site
From: dnljms_at_[hidden]
Date: 2011-07-17 18:09:26
Author: danieljames
Date: 2011-07-17 18:09:26 EDT (Sun, 17 Jul 2011)
New Revision: 73205
URL: http://svn.boost.org/trac/boost/changeset/73205
Log:
Website: Encode xml before adding it to the rss feed.
Text files modified:
website/public_html/beta/site-tools/boost_site/site_tools.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
Modified: website/public_html/beta/site-tools/boost_site/site_tools.py
==============================================================================
--- website/public_html/beta/site-tools/boost_site/site_tools.py (original)
+++ website/public_html/beta/site-tools/boost_site/site_tools.py 2011-07-17 18:09:26 EDT (Sun, 17 Jul 2011)
@@ -108,7 +108,7 @@
</channel>
</rss>
''' % {
- 'title' : details['title'],
+ 'title' : details['title'].encode('utf-8'),
'link' : "http://www.boost.org/" + feed_file,
'description' : '',
'language' : 'en-us',
@@ -124,13 +124,16 @@
item = rss_feed.createElement('item')
- node = xml.dom.minidom.parseString('<title>%s</title>' % page.title_xml)
+ node = xml.dom.minidom.parseString('<title>%s</title>'
+ % page.title_xml.encode('utf-8'))
item.appendChild(rss_feed.importNode(node.documentElement, True))
- node = xml.dom.minidom.parseString('<link>%s</link>' % page_link)
+ node = xml.dom.minidom.parseString('<link>%s</link>'
+ % page_link.encode('utf-8'))
item.appendChild(rss_feed.importNode(node.documentElement, True))
- node = xml.dom.minidom.parseString('<guid>%s</guid>' % page_link)
+ node = xml.dom.minidom.parseString('<guid>%s</guid>'
+ % page_link.encode('utf-8'))
item.appendChild(rss_feed.importNode(node.documentElement, True))
# TODO: Convert date format?
@@ -140,7 +143,8 @@
node = rss_feed.createElement('description')
# Placing the description in a root element to make it well formed xml.
- description = xml.dom.minidom.parseString('<x>%s</x>' % page.description_xml)
+ description = xml.dom.minidom.parseString(
+ '<x>%s</x>' % page.description_xml.encode('utf-8'))
base_links(description, page_link)
node.appendChild(rss_feed.createTextNode(
boost_site.util.fragment_to_string(description)))
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk