|FAQ Index - Search - Recent Changes - Everything - Add entry|
23.40. Is g_utf8_collate and g_utf8_collate_key available in PyGTK?
g_utf8_collate and g_utf8_collate_key are two functions available in glib which compares strings using the correct locale.
They are not available in PyGTK, but don't worry you can just use the locale module to do the same thing;
g_utf8_collate(mystr, mystr2) is the same as; locale.strcoll(mystr, mystr2)and
g_utf8_collate_key(mystr) is the same as; locale.strxfrm(mystr)There's a third function in glib which is called g_utf8_collate_key_for_filename which doesn't have a similar implementation in python.
Remember to import pango or gtk for these functions to work properly.