GNOME Bugzilla – Bug 320968
locale encoded filename are not displayed correctly
Last modified: 2007-08-14 17:11:53 UTC
Version details: 2.12.1 Distribution/Version: Mandriva cooker -set G_FILENAME_ENCODING="@locale" in your profile environment -in sabayon environment, create "Vidéo" file -check file change in sabayon => Vidéo will be truncated to Vid and you get : /usr/lib/sabayon-session:41:PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text () or /usr/lib/python2.4/site-packages/sabayon/sessionwindow.py:260 : PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text ()
I could be wrong, but I think the solution here is to use gobject.filename_display_name: http://www.pygtk.org/docs/pygobject/gobject-functions.html#function-gobject--filename-display-name The method is only in PyGTK 2.10, which I don't yet have on my system. Attaching a patch which probably does what we want-- if someone who does have PyGTK 2.10 on their system wants to verify and apply, go ahead.
Created attachment 74379 [details] [review] Patch to make the filesource pass back filenames in utf8 encoding, always
Okay, just verified that this patch works as expected with pygobject 2.12 or better installed. Of course, applying it means that we'll have to bump our pygobject requirement as well. Ok to commit the above patch + a modification to configure.ac to require pygobject 2.12 or greater?
Oooh, good catch! Thanks for the patch; I've committed it and added a check for pygobject 2.12.0 (this is all in trunk; should appear in sabayon-2.19.2). 2007-08-14 Federico Mena Quintero <federico@novell.com> * configure.ac: Add a requirement for pygobject 2.12.0 or later for pygobject.filename_display_name(). * lib/sources/filessource.py (FilesChange.get_short_description): Convert the filename to UTF-8 before generating a string for display. Patch by Will Lachance <wrlach@gmail.com>. Fixes http://bugzilla.gnome.org/show_bug.cgi?id=320968