[pygtk] assertion g_utf8_validate failed when I set text to textview

nohics nohics nohics at gmail.com
Thu Jul 16 20:48:25 WST 2009


But how can we know what's all the invalid UTF-8 characters (like \x00) ?

2009/7/15 saeed <saeed.gnu at gmail.com>

> Maybe the string has invalid UTF-8 characters. You may check and
> correct it maulally, for example:
> data = data.replace('\x00', '').decode('utf-8', 'replace').encode('utf-8')
>
> On 7/15/09, nohics nohics <nohics at gmail.com> wrote:
> > Hello all, I'm getting this error when I set a text on the textview (the
> > text that I receive from an irc server when I connect to it):
> > GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate
> (text,
> > len, NULL)' failed
> >    textviewBuffer.insert(textviewBuffer.get_end_iter(), data)
> >
> > What's the problem ?
> > Thank you.
> >
>
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? nettoy?e...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090716/02ec1a1f/attachment.htm 


More information about the pygtk mailing list