# HG changeset patch # User Paul Boddie # Date 1371218361 -7200 # Node ID 448e3575c8ddacb77d121d0aacbfe98cb7bbb678 # Parent f933c3145dcb1837072ddb56a8b6b989ed85f773 Introduced a Unicode workaround for StringIO usage. diff -r f933c3145dcb -r 448e3575c8dd MoinShare.py --- a/MoinShare.py Fri Jun 14 01:19:43 2013 +0200 +++ b/MoinShare.py Fri Jun 14 15:59:21 2013 +0200 @@ -169,9 +169,9 @@ if format == "html": update.content = body elif hasattr(parser, "formatForOutputType"): - s = StringIO() + s = codecs.getwriter("utf-8")(StringIO()) parser.formatForOutputType("text/html", write=s.write) - update.content = s.getvalue() + update.content = unicode(s.getvalue(), "utf-8") else: fmt = request.html_formatter fmt.setPage(page) diff -r f933c3145dcb -r 448e3575c8dd macros/SharedContent.py --- a/macros/SharedContent.py Fri Jun 14 01:19:43 2013 +0200 +++ b/macros/SharedContent.py Fri Jun 14 15:59:21 2013 +0200 @@ -332,6 +332,8 @@ append(fmt.div(on=1, css_class="moinshare-update")) append(fmt.div(on=1, css_class="moinshare-content")) + # NOTE: Handle multipart/alternative. + if update.content: if update.content_type == "text/html" and update.message_number is not None: parsers = [get_make_parser(update.page, update.message_number)]