fix xhtml

This commit is contained in:
Denis Fomin 2013-01-06 12:35:10 +04:00
parent 4bf62193f3
commit 60aa7f073a
2 changed files with 3 additions and 2 deletions

View File

@ -1363,7 +1363,7 @@ class ConversationTextview(GObject.GObject):
try:
if name and (text.startswith('/me ') or text.startswith('/me\n')):
xhtml = xhtml.replace('/me', '<i>* %s</i>' % (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))

View File

@ -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