# HG changeset patch # User Raphael Bossek # Date 1186778449 -7200 # Node ID 29682a94eef87170b1ad38d3afb8fe99a0fdd419 # Parent 5c7abdf6554e2908f78c6853625c7ce65cca84b2 Do not convert unicode string into utf-8 encoded byte string by default diff -r 5c7abdf6554e -r 29682a94eef8 MoinMoin/parser/text_xslt.py --- a/MoinMoin/parser/text_xslt.py Tue Aug 07 14:12:39 2007 +0200 +++ b/MoinMoin/parser/text_xslt.py Fri Aug 10 22:40:49 2007 +0200 @@ -28,7 +28,7 @@ class Parser: Dependencies = Dependencies def __init__(self, raw, request, **kw): - self.raw = raw.encode(config.charset) + self.raw = raw self.request = request self.form = request.form self._ = request.getText @@ -87,14 +87,16 @@ class Parser: input_factory = InputSource.InputSourceFactory(resolver=wiki_resolver) page_uri = self.base_uri + wikiutil.url_quote(formatter.page.page_name) - raw = self.raw.strip() + # 4Suite needs an utf-8 encoded byte string instead of an unicode object + raw = self.raw.strip().encode(config.charset) self.processor = Processor() self.append_stylesheet() # hook, for extending this parser self.processor.run( input_factory.fromString(raw, uri=page_uri), outputStream=out_file) - result = out_file.getvalue() + # Convert utf-8 encoded byte string into unicode + result = out_file.getvalue().decode(config.charset) result = self.parse_result(result) # hook, for extending this parser except FtException, msg: