Re: what is the encoding of returned string of gnome_file_entry_get_full_path()?



On Wed, 2005-11-09 at 19:55 +0800, yandong.yao wrote:
>    The fix is pretty simple, we can use g_filename_from_utf8() to 
> convert utf8 encoded filename to Glib encoded filename.
> 
>    What I wondering is that where we shoud put g_filename_from_utf8() 
> in? it should in refresh_preview() or gnome_file_entry_get_full_path()?
> 
>    If in refresh_preview(), then I guess we should modify all gnome 
> codes where call gnome_file_entry_get_full_path().  So I think it will 
> be more better if we fix it in gnome_file_entry_get_full_path(), just 
> like gtk_file_selection_get_filename() which return the selected 
> filename in the Glib filename encoding.
> 
>    How do you think? any suggestions are welcome!

GnomeFileEntry looks pretty broken. It gets the filename, converts it to
utf8 with g_filename_to_utf8() and stores that in the entry, which it
then returns from gnome_file_entry_get_full_path(). At the very least it
should convert back to filename encoding before returning, but its also
possible that g_filename_to_utf8() fails, which totatlly breaks the
widget, making it impossible to pick such a file.

Maybe you can use GtkFileChooserButton instead.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a suicidal white trash romance novelist for the 21st century. She's a 
wealthy Buddhist detective with someone else's memories. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]