diff options
author | Richard Darst <rkd@zgib.net> | 2009-07-02 18:00:43 (GMT) |
---|---|---|
committer | Richard Darst <rkd@zgib.net> | 2009-07-02 18:00:43 (GMT) |
commit | 1c3fb3207b094222aaa08bfb7b30245f51c0bac4 (patch) | |
tree | e12a59e6c37377cbcd4822532f8f8ef3421c1ee3 /writers.py | |
parent | 5e763943c6b15ac0684da4c5b504a4c4d06e10d7 (diff) |
Fix encoding issue of reST->HTML version writer
darcs-hash:20090702180043-82ea9-5c15ca5b47dbd4c72e02f4a6c6a4ba6ff09f7ce5.gz
Diffstat (limited to 'writers.py')
-rw-r--r-- | writers.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -347,5 +347,12 @@ class HTMLfromRST(_BaseWriter): rst = RST(M).format() rstToHTML = docutils.core.publish_string(rst, writer_name='html', settings_overrides={'file_insertion_enabled': 0, - 'raw_enabled': 0}) + 'raw_enabled': 0, + 'output_encoding':'utf-8'}) + # Unfortunantly, docutils forces us to encode to some charset. + # We have to return a utf-8 thing to be encoded later, so we + # hack decode here, only to be re-encoded later. (I've dug + # into the docutils internals, it's not obvious that I could + # do this easily.) + rstToHTML = rstToHTML.decode('utf-8', 'replace') return rstToHTML |