# HG changeset patch # User Paul Boddie # Date 1383436574 -3600 # Node ID 030d99ed978b980b275fdaaa00bd699bb7e5e812 # Parent 6ad31856efbffe184b2dfd2e1c0d0b5e30c9656d Fixed Unicode handling of subpage data. (Not sure how the Include macro manages to work because of this kind of thing.) diff -r 6ad31856efbf -r 030d99ed978b macros/IncludeComments.py --- a/macros/IncludeComments.py Sun Nov 03 00:45:49 2013 +0100 +++ b/macros/IncludeComments.py Sun Nov 03 00:56:14 2013 +0100 @@ -17,6 +17,7 @@ from MoinMoin.user import User from MoinMoin.wikiutil import escape import re +import codecs try: from cStringIO import StringIO @@ -129,13 +130,13 @@ # Output the included page. - strfile = StringIO() + strfile = codecs.getwriter("utf-8")(StringIO()) request.redirect(strfile) try: inc_page.send_page(content_only=True, omit_footnotes=True, count_hit=False) - append(strfile.getvalue()) + append(unicode(strfile.getvalue(), "utf-8")) finally: request.redirect()