After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 577241 - Gtk2::FileChooser get_filename() returning byte string
Gtk2::FileChooser get_filename() returning byte string
Status: RESOLVED OBSOLETE
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-03-29 23:42 UTC by Kevin Ryde
Modified: 2021-07-05 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
failing program (555 bytes, text/plain)
2009-03-29 23:44 UTC, Kevin Ryde
  Details
char instead of gchar (1.01 KB, patch)
2009-03-29 23:46 UTC, Kevin Ryde
none Details | Review

Description Kevin Ryde 2009-03-29 23:42:47 UTC
As noted on the mailing list a little while ago, it looks like Gtk2::FileChooser::get_filename() should return a byte string rather than treat it as utf8.

The prototype for gtk_file_chooser_get_filename() has gchar*, but under the heading "Important" in the docs http://library.gnome.org/devel/gtk/unstable/GtkFileChooser.html#GtkFileChooser.description it's described as ready to pass to open() and not suitable to put in a GtkLabel.

That seems to be how the code is too.  In the foo.pl below clicking on the latin-1 y-diaeresis file in the selection list gets an error

    Malformed UTF-8 character (overflow at 0x40000036, byte 0x17, after start byte 0xff) in subroutine entry at /usr/lib/perl/5.10/Data/Dumper.pm line 190.

and some printfs show it's a raw 0xFF byte.

The only concern might be that when you enter a name in the entry box and press return, in that case get_filename returns utf8.  Presumably that's a gtk bug.

The same applies to the multi-select gtk_file_chooser_get_filenames().
Comment 1 Kevin Ryde 2009-03-29 23:44:04 UTC
Created attachment 131653 [details]
failing program
Comment 2 Kevin Ryde 2009-03-29 23:46:38 UTC
Created attachment 131654 [details] [review]
char instead of gchar
Comment 3 GNOME Infrastructure Team 2021-07-05 12:22:29 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME?utf8=%E2%9C%93&filter=perl-

Thank you for your understanding and your help.