From: Huang Peng Date: Thu, 12 Jun 2008 01:47:11 +0000 (+0800) Subject: Convert bytes offset to characters offset. X-Git-Tag: 0.1.0.20080810~413 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac3e3a1cf72611cba09fbccd2faf0c6d0cbf884a;p=platform%2Fupstream%2Fibus.git Convert bytes offset to characters offset. --- diff --git a/engine/anthy/engine.py b/engine/anthy/engine.py index b23ad90..2964aee 100644 --- a/engine/anthy/engine.py +++ b/engine/anthy/engine.py @@ -16,7 +16,7 @@ class Engine (interface.IEngine): # create anthy context self._context = anthy.anthy_context () - self._context._set_encoding (2) + self._context._set_encoding (anthy.ANTHY_UTF8_ENCODING) self._lookup_table = ibus.LookupTable () self._prop_list = ibus.PropList () @@ -169,7 +169,8 @@ class Engine (interface.IEngine): i += 1 attrs = ibus.AttrList () - attrs.append (ibus.AttributeUnderline (pango.UNDERLINE_SINGLE, 0, len (self._convert_chars.encode ("utf-8")))) + attrs.append (ibus.AttributeUnderline (pango.UNDERLINE_SINGLE, 0, len (self._convert_chars))) + # attrs.append (ibus.AttributeBackground (ibus.RGB (256, 0, 0), ) self.UpdatePreedit (dbus.String (self._convert_chars), attrs.to_dbus_value (),