tis 2003-01-14 klockan 21.49 skrev mc collilieux:
> Hello, 
> I am trying to transform onr programm with pygtk 0.6 in pygtk2. It is a
> list of titles of books in french (with gtk.Treeview) from a mysql base
> with much é è or à in the titles. I have this error :
> (liste4.py:1881): WARNING **: Invalid UTF8 string passed to
> pango_layout_set_text()

Before inserting data into the liststore, convert them to utf-8.

First you need to convert to a unicode object, this can be done like
this:
obj = unicode(some_string, 'latin-1')

Then you can convert it to utf-8:

utf8string = obj.encode('utf-8')

and that string is what you should insert into your model
(GtkListStore/GtkTreeStore)

-- 
Johan Dahlin <[EMAIL PROTECTED]>
Async Open Source

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to