Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/writers.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-07 20:06:21 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-07 20:06:21 (GMT)
commitaded36e115745c500c23ae06cfd283298dbddf3a (patch)
tree874aa0a0a8c890ccbd05a0b3d7f4ca93f6ee7f98 /writers.py
parentcf146c429e093b7cb324fc401016df6551ea87a8 (diff)
Improve mechanisms of encoding
- we now let writers return already-encoded text, this helps in a few cases. darcs-hash:20090707200621-82ea9-e012cd62add13db0c62016414585846a6ed817f7.gz
Diffstat (limited to 'writers.py')
-rw-r--r--writers.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/writers.py b/writers.py
index 31be343..3d7394a 100644
--- a/writers.py
+++ b/writers.py
@@ -140,7 +140,8 @@ class HTMLlog(_BaseWriter):
# That's only right before the i/o functions in the Config
# object.
formatter = HtmlFormatter(lineanchors='l',
- full=True, style=M.config.pygmentizeStyle)
+ full=True, style=M.config.pygmentizeStyle,
+ output_encoding=self.M.config.output_codec)
Lexer = IrcLogsLexer
Lexer.tokens['msg'][1:1] = \
[ # match: #topic commands
@@ -390,11 +391,5 @@ class HTMLfromReST(_BaseWriter):
rstToHTML = docutils.core.publish_string(rst, writer_name='html',
settings_overrides={'file_insertion_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')
+ 'output_encoding':self.M.config.output_codec})
return rstToHTML