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

2009/7/15 saeed <[email protected]>

> 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 <[email protected]> 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.
> >
>
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to