CVS: ht2html PDOGenerator.py,2.19,2.20

David Goodger <[email protected]> Wed, 21 Jul 2004 18:06:30 -0700
Newsgroups gmane.comp.web.ht2html.devel
Message-ID <[email protected]>
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:



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click