Ticket #8219: rss.patch

File rss.patch, 2.4 KB (added by alperkanat, 7 years ago)

decoding ascii instead of utf-8

  • utils/feedgenerator.py

     
    158158            handler.addQuickElement(u"category", cat)
    159159        if self.feed['feed_copyright'] is not None:
    160160            handler.addQuickElement(u"copyright", self.feed['feed_copyright'])
    161         handler.addQuickElement(u"lastBuildDate", rfc2822_date(self.latest_post_date()).decode('ascii'))
     161        handler.addQuickElement(u"lastBuildDate", rfc2822_date(self.latest_post_date()).decode('utf-8'))
    162162        if self.feed['ttl'] is not None:
    163163            handler.addQuickElement(u"ttl", self.feed['ttl'])
    164164        self.write_items(handler)
     
    200200                handler.addQuickElement(u"dc:creator", item["author_name"], {"xmlns:dc": u"http://purl.org/dc/elements/1.1/"})
    201201
    202202            if item['pubdate'] is not None:
    203                 handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('ascii'))
     203                handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('utf-8'))
    204204            if item['comments'] is not None:
    205205                handler.addQuickElement(u"comments", item['comments'])
    206206            if item['unique_id'] is not None:
     
    236236        if self.feed['feed_url'] is not None:
    237237            handler.addQuickElement(u"link", "", {u"rel": u"self", u"href": self.feed['feed_url']})
    238238        handler.addQuickElement(u"id", self.feed['id'])
    239         handler.addQuickElement(u"updated", rfc3339_date(self.latest_post_date()).decode('ascii'))
     239        handler.addQuickElement(u"updated", rfc3339_date(self.latest_post_date()).decode('utf-8'))
    240240        if self.feed['author_name'] is not None:
    241241            handler.startElement(u"author", {})
    242242            handler.addQuickElement(u"name", self.feed['author_name'])
     
    260260            handler.addQuickElement(u"title", item['title'])
    261261            handler.addQuickElement(u"link", u"", {u"href": item['link'], u"rel": u"alternate"})
    262262            if item['pubdate'] is not None:
    263                 handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('ascii'))
     263                handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('utf-8'))
    264264
    265265            # Author information.
    266266            if item['author_name'] is not None:
Back to Top