# HG changeset patch
# User Raphael Bossek <raphael.bossek@gmx.de>
# Date 1185565512 -7200
# Node ID e35b2d00b1b6fc6cb6075c1c4136ac2d1e1148e8
# Parent  b6c92549b7cbe59858c64433f36b48a01c9dd7ca
Decode XML content only if 4Suite is available. Otherwise keep the data as it is. UTF-8 encoded XML files has to be processed unchanged.

diff -r b6c92549b7cb -r e35b2d00b1b6 MoinMoin/parser/text_xslt.py
--- a/MoinMoin/parser/text_xslt.py	Thu Jul 26 13:03:11 2007 +0200
+++ b/MoinMoin/parser/text_xslt.py	Fri Jul 27 21:45:12 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,8 +87,10 @@ 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 need ASCII coding instead of UTF-8.
+                raw = self.raw.strip().encode(config.charset)
+                
                 self.processor = Processor()
                 self.append_stylesheet() # hook, for extending this parser
                 self.processor.run(
