Gnome::VFS::URI path problem

Hi all,

I'm trying to set up a SimpleList that will accept DND from a FileChooserWidget as well as from nautilus. I used Dave O's example at as a starting point. While I can get the filename from the drop event data, the path is horribly mangled with wrongly-encoded text, it seems.

sub drag_data_received{
    my ($treeview, $context, $widget_x, $widget_y,$data,$info,$time) = @_;
    my @uris = Gnome2::VFS::URI->list_parse($data->data);

    for my $uri (@uris){
        my $dirname = $uri->get_path();
        push @{$treeview->{data}}, $dirname.'/'.$uri->extract_short_name();

The extract_short_name() method works fine, as does extract_short_path(). However, any method that returns the path of the selected item (extract_dirname, get_path, to_string) returns poorly-encoded text. It may also be worth noting that the text does seem partially intact, and the bits that aren't right seem somewhat random. In other words, you can DND the same file over and over, and get a different result each time.

The following warning is generated:

Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text() at ./ line 72.

I've scoured the web looking for others with this problem, and haven't had any luck. This makes me wonder if there is something I'm doing wrong, or if there is something unusual about my Gnome or Perl setup. I've tried my script on two machines, both Ubuntu Hardy Heron machines, and have gotten the exact same result.

Has anyone seen this before, or have any ideas how I might go about tracking down this issue?

Ubuntu 8.04
libgtk2-perl version 1:1.161-1
libglib-perl version 1:1.161-1
libgnome2-perl version 1.040-1
libgnome2-vfs-perl version 1.080-1
Perl version 5.8.8-12


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