Re: GtkFileChooser::get_filenames / get_uris override

From: Date: Fri, 10 Mar 2006 04:10:29 +0000
Subject: Re: GtkFileChooser::get_filenames / get_uris override
References: 1 2 3  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2555@lists.php.net to get a copy of this message
And that's the problem really. What if you want to both use the filename in the widget _and_ pass it to fopen()? If you convert it to the php_gtk.codepage encoding you may have trouble using fopen(). If you don't convert anything at all, your fopen() will work but your Gtk+ widgets might not be able to display the filename. Perhaps we need an extra parameter to these functions to indicate the intended usage of the result so that it knows whether to do the conversion or not. -Andrei On Mar 9, 2006, at 3:08 AM, Christian Weiske wrote:
They have to be converted. I tried the following, which doesn't work unfortunately:
            cp_ret = phpg_from_utf8(files->data, strlen(files->data),
This can't work, as it isn't real utf-8: ----------------- This means that while you can pass the result of gtk_file_chooser_get_filename() to open(2) or fopen(3), you may not be able to directly set it as the text of a GtkLabel widget unless you convert it first to UTF-8, which all GTK+ widgets expect. You should use g_filename_to_utf8() to convert filenames into strings that can be passed to GTK+ widgets. ----------------- --Regards/MfG, Christian Weiske


« previous php.gtk.dev (#2555) next »