Attachment 'text_xslt.py.txt'
Download 1 # HG changeset patch
2 # User Raphael Bossek <raphael.bossek@gmx.de>
3 # Date 1186778449 -7200
4 # Node ID 29682a94eef87170b1ad38d3afb8fe99a0fdd419
5 # Parent 5c7abdf6554e2908f78c6853625c7ce65cca84b2
6 Do not convert unicode string into utf-8 encoded byte string by default
7
8 diff -r 5c7abdf6554e -r 29682a94eef8 MoinMoin/parser/text_xslt.py
9 --- a/MoinMoin/parser/text_xslt.py Tue Aug 07 14:12:39 2007 +0200
10 +++ b/MoinMoin/parser/text_xslt.py Fri Aug 10 22:40:49 2007 +0200
11 @@ -28,7 +28,7 @@ class Parser:
12 Dependencies = Dependencies
13
14 def __init__(self, raw, request, **kw):
15 - self.raw = raw.encode(config.charset)
16 + self.raw = raw
17 self.request = request
18 self.form = request.form
19 self._ = request.getText
20 @@ -87,14 +87,16 @@ class Parser:
21 input_factory = InputSource.InputSourceFactory(resolver=wiki_resolver)
22
23 page_uri = self.base_uri + wikiutil.url_quote(formatter.page.page_name)
24 - raw = self.raw.strip()
25 + # 4Suite needs an utf-8 encoded byte string instead of an unicode object
26 + raw = self.raw.strip().encode(config.charset)
27
28 self.processor = Processor()
29 self.append_stylesheet() # hook, for extending this parser
30 self.processor.run(
31 input_factory.fromString(raw, uri=page_uri),
32 outputStream=out_file)
33 - result = out_file.getvalue()
34 + # Convert utf-8 encoded byte string into unicode
35 + result = out_file.getvalue().decode(config.charset)
36 result = self.parse_result(result) # hook, for extending this parser
37
38 except FtException, msg:
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.