Hi all,
I got a problem using the method insert_at_cursor applied at the 
TextBuffer object.
the Worning is :
GtkWarning: gtk_text_buffer_emit_insert: 
assertion `g_utf8_validate (text, len, NULL)' failed
  _tb.insert_at_cursor(_s)


I read the data from a file *.dxf and i try to populate the TextBuffer....

I 
know that it's not a problem of the text buffer (He want unicode char ...).. 
but may be someone have olready meet this problem.

Googoling .. i found a lot 
of article and they suggest to use function like the following to conver the 
string .. but i get always the some error ..

def to_unicode(obj, encoding='utf-
8'):
    """
        Transform a string in a different format Default utf-8
    
"""
    if isinstance(obj, basestring):
        if not isinstance(obj, 
unicode):
            obj = unicode(obj, encoding)
        return obj
    else:

        raise TypeError, "Invalid object type : " + `type(obj)`

Thanks 
Matteo

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to