From 60aa7f073ae7bbbd3d8b7fc73178702dd50f91e9 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sun, 6 Jan 2013 12:35:10 +0400 Subject: [PATCH] fix xhtml --- src/conversation_textview.py | 2 +- src/htmltextview.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 77ababa20..de5be4f79 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -1363,7 +1363,7 @@ class ConversationTextview(GObject.GObject): try: if name and (text.startswith('/me ') or text.startswith('/me\n')): xhtml = xhtml.replace('/me', '* %s' % (name,), 1) - self.tv.display_html(xhtml.encode('utf-8'), self) + self.tv.display_html(xhtml, self) return except Exception as e: gajim.log.debug('Error processing xhtml' + str(e)) diff --git a/src/htmltextview.py b/src/htmltextview.py index 7c6d33c42..81c6c8aad 100644 --- a/src/htmltextview.py +++ b/src/htmltextview.py @@ -525,7 +525,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler): # The "data" URL scheme http://tools.ietf.org/html/rfc2397 import base64 img = attrs['src'].split(',')[1] - mem = base64.standard_b64decode(urllib.parse.unquote(img)) + mem = base64.standard_b64decode(urllib.parse.unquote( + img).encode('utf-8')) elif loaded is not None: (mem, alt, replace_mark) = loaded update = True