When inserting into a text buffer, it wants the length in bytes, not characters; python's len(), however, returns the number of characters. A very easy way around this is to always use -1 as the length function, as that'll just insert the whole string.
Abe On Thu, 20 Feb 2003, Anthony Tekatch wrote: > > I am having a problem while inserting a string containing UTF-8 characters > into TextBuffer for display in a TextView. The displayed string in the > textview is always truncated by the same number of special UTF-8 > characters. For example if I want to display 32degF (where: deg is the > degree symbol), I would insert the string u'32\xb0F', the result is that > the last character is missing from the textview. > > I am using gtk.TextBuffer.insert_at_cursor and my length is 4 for the > above example. > > > Thanks in advance. > > -- > Anthony Tekatch > _______________________________________________ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ > _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
