[Dicson and I] fix some unicode issues

This commit is contained in:
Yann Leboulanger 2012-12-30 23:47:31 +01:00
parent 2acaa2e075
commit b6b3bcb552
2 changed files with 14 additions and 2 deletions

View File

@ -46,6 +46,7 @@ import caps_cache
import socket
import time
from gi.repository import GObject
from encodings.punycode import punycode_encode
from string import Template
@ -474,6 +475,17 @@ def ensure_utf8_string(string):
pass
return string
def wrapped_ensure_utf8_string(fn):
def wrapped(n):
return ensure_utf8_string(n)
return wrapped
@wrapped_ensure_utf8_string
def escape_text(text):
return GObject.markup_escape_text(text)
GObject.markup_escape_text = escape_text
def get_windows_reg_env(varname, default=''):
"""
Ask for paths commonly used but not exposed as ENVs in english Windows 2003

View File

@ -487,11 +487,11 @@ class RosterTooltip(NotificationAreaTooltip):
vcard_current_row = 1
properties = []
name_markup = u'<span weight="bold">' + \
name_markup = '<span weight="bold">' + \
GObject.markup_escape_text(prim_contact.get_shown_name())\
+ '</span>'
if gajim.config.get('mergeaccounts'):
name_markup += u" <span foreground='%s'>(%s)</span>" % (
name_markup += " <span foreground='%s'>(%s)</span>" % (
gajim.config.get('tooltip_account_name_color'),
GObject.markup_escape_text(prim_contact.account.name))