- output = ''
- output += '<div class="item">\n'
- output += '<h2>%s: %s</h2>\n' % (item.blogTitle, item.itemTitle)
- output += '<p class="time">\n'
+ try:
+ blogTitle, blogName, itemTitle = map(unicode, [item.blogTitle, item.blogName, item.itemTitle])
+ except UnicodeDecodeError, e:
+ print >> sys.stderr, "Unicode error in %s" % item.itemURL
+ print >> sys.stderr, e
+ return ''
+
+ output = u''
+ output += u'<div class="item">\n'
+ output += u'<h2><a href="%s" title="%s">%s</a>: <a href="%s">%s</a></h2>\n' % (item.blogURL, blogTitle, blogName, item.itemURL, itemTitle)
+ output += u'<p class="time">\n'