Index: PyRSS2Gen.py =================================================================== --- PyRSS2Gen.py (revision 59960) +++ PyRSS2Gen.py (working copy) @@ -10,14 +10,14 @@ # Could make this the base class; will need to add 'publish' class WriteXmlMixin: - def write_xml(self, outfile, encoding = "iso-8859-1"): + def write_xml(self, outfile, encoding = "utf-8"): from xml.sax import saxutils handler = saxutils.XMLGenerator(outfile, encoding) handler.startDocument() self.publish(handler) handler.endDocument() - def to_xml(self, encoding = "iso-8859-1"): + def to_xml(self, encoding = "utf-8"): try: import cStringIO as StringIO except ImportError: Index: pep2rss.py =================================================================== --- pep2rss.py (revision 59960) +++ pep2rss.py (working copy) @@ -4,13 +4,14 @@ # (standard post-commit args) import os, glob, time, datetime, stat, re, sys +import codecs from subprocess import Popen, PIPE import PyRSS2Gen as rssgen RSS_PATH = os.path.join(sys.argv[1], 'peps.rss') def firstline_startingwith(full_path, text): - for line in file(full_path): + for line in codecs.open(full_path, encoding="utf-8"): if line.startswith(text): return line[len(text):].strip() return None @@ -46,7 +47,7 @@ pass title = firstline_startingwith(full_path, 'Title:') author = firstline_startingwith(full_path, 'Author:') - url = 'http://www.python.org/dev/peps/pep-%d' % n + url = 'http://www.python.org/dev/peps/pep-%0.4d' % n item = rssgen.RSSItem( title = 'PEP %d: %s' % (n, title), link = url,