diff --git a/rigo/rigo/ui/gtk3/widgets/cellrenderers.py b/rigo/rigo/ui/gtk3/widgets/cellrenderers.py index 3e96c4bc1..073bf0ec4 100644 --- a/rigo/rigo/ui/gtk3/widgets/cellrenderers.py +++ b/rigo/rigo/ui/gtk3/widgets/cellrenderers.py @@ -19,9 +19,10 @@ from gi.repository import Gtk, Gdk, GObject, Pango +from entropy.const import const_convert_to_unicode + from rigo.em import EM from rigo.models.application import CategoryRowReference -from rigo.utils import utf8 from stars import StarRenderer, StarSize @@ -459,7 +460,8 @@ class CellButtonRenderer: max_size = (0,0) for k, variant in self.markup_variants.items(): - safe_markup = GObject.markup_escape_text(utf8(variant)) + safe_markup = GObject.markup_escape_text( + const_convert_to_unicode(variant)) layout.set_markup(safe_markup, -1) size = layout.get_size() max_size = max(max_size, size) diff --git a/rigo/rigo/utils.py b/rigo/rigo/utils.py index 75a6f920d..3af9b9fc1 100644 --- a/rigo/rigo/utils.py +++ b/rigo/rigo/utils.py @@ -35,15 +35,3 @@ class ExecutionTime(object): def __exit__(self, type, value, stack): logger = logging.getLogger("softwarecenter.performance") logger.debug("%s: %s" % (self.info, time.time() - self.now)) - -def utf8(s): - """ - Takes a string or unicode object and returns a utf-8 encoded - string, errors are ignored - FIXME: lxnay, drop this crap and use Entropy functions instead. - """ - if s is None: - return None - if isinstance(s, unicode): - return s.encode("utf-8", "ignore") - return unicode(s, "utf8", "ignore").encode("utf8")