Re: URIs, D&D and bug #48423



On 22 May 2002, Michael Meeks wrote:

> Hi Alex,
> 
> On Tue, 2002-05-21 at 16:15, Alex Larsson wrote:
> > > 	Is. I ask this because in bug #48423, we blindly accept that the
> > > incoming URI in the D&D list is in fact a URI, and not a mangled
> > > filename. And we emit a 'location_changed' signal with it as the string,
> > > all of which ends up doing:
> > 
> > I don't think we should be sending broken URI-lists like that. We should 
> > be using g_filename_to_uri() so all apps use the same way of encoding the 
> > URIs. We spent a lot of time getting the behaviour of that function right, 
> > and it's what the Gtk+ fileselector uses for DnD.
> 
> 	Um; wait - we already have a correctly escaped URI in the method I
> mentioned, and we deliberately break it so it works with Gnome 1.4's
> gnome-libs. Are you certain that you want to break compatibility with
> that ? if so fine.

The g_filename_to/from_uri calls are a bit special. In order to have a 
well specified encoding of the uri sent they convert the filename with 
g_filename_to_utf8() before encoding it in the uri. This means that if you 
have G_BROKEN_FILENAMES set in the environment there will be a charset 
conversion from the users current locale. 

Inside Nautilus, file: uri's are currently in an "unknown" encoding, with 
the same byte values as the ones on the filesystem. But at process 
boundaries (and even possible machine boundaries) like what happens with 
DnD, we should have a well specified format of the data sent, so the 
recieving app knows how to interpret the bytes it gets.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a short-sighted devious paramedic who hides his scarred face behind a 
mask. She's a brilliant mutant research scientist from the wrong side of the 
tracks. They fight crime! 





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