From: David G. <go...@us...> - 2004-07-22 01:06:36
|
Update of /cvsroot/ht2html/ht2html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8878 Modified Files: PDOGenerator.py Log Message: Treat RST & HTML uniformly; decode & encode both. (Rev. 2.19 checkin message should have been """added support for "encoding" header""".) Index: PDOGenerator.py =================================================================== RCS file: /cvsroot/ht2html/ht2html/PDOGenerator.py,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** PDOGenerator.py 20 Jul 2004 23:16:55 -0000 2.19 --- PDOGenerator.py 22 Jul 2004 01:06:28 -0000 2.20 *************** *** 161,164 **** --- 161,165 ---- if self.__body is None: data = self.__parser.fp.read() + # convert to Unicode: text = data.decode(self.get_encoding()) if self.get_content_type() == 'text/x-rst': *************** *** 167,171 **** else: text = rst_html.process_rst(self.filename, text) ! i = text.find('<!--table-stop-->') if i >= 0: --- 168,173 ---- else: text = rst_html.process_rst(self.filename, text) ! # convert Unicode back to 8-bit string: ! text = text.encode(self.get_charset(), 'xmlcharrefreplace') i = text.find('<!--table-stop-->') if i >= 0: |