Re: Plans for gnome-vfs replacement



On Mon, 2006-09-25 at 10:29 -0400, Dan Winship wrote:
> Alexander Larsson wrote:
> > On Sun, 2006-09-24 at 22:49 -0400, Dan Winship wrote:
> >> There might also be problems with IRI-based gvfs and URI-based gnome-vfs
> >> wanting to using different URLs to refer to the same file?
> > 
> > Thats already possible in thousands of ways. You can use different case
> > for hex escape, escape various sets of chars, add "/./" to the path,
> > etc, etc. Non-canonicalized URIs are very much not unique.
> 
> Right, sorry, I meant I was wondering if there were cases where the
> *canonicalized* forms are different in an incompatible/incomprehensible
> way. Like if gvfs thought "ftp://ftp.gnome.org/dir/a%20%E5%E4%F6.txt";
> pointed to a file with an iso-8859-1-encoded name, and gnome-vfs thought
> it pointed to a file with a UTF-8-encoded name, and so you'd either get
> a different file or a file not found error when you traded the URI
> between gvfs and gnome-vfs. (That example is probably completely bogus,
> which is why I didn't give an example in my original mail, but hopefully
> you get the idea.)

All URIs are valid IRIs. All IRIs are either a valid URI refering to the
same file, or an invalid URI (one that contains chars that are not
allowed). The only difference between the two formats is that if a URI
has escaped chars that would unescape to valid utf8, it would be a valid
IRI if they were unescaped.

We never actually care about the encoding of the filename for any uri
operations other than displaying it. I.E. even if we know the ftp uses
iso-8859-1 filename encodings we don't convert the a%20%E5%E4%F6.txt in
your example to utf8, because that would result in the problem that you
explain. The only thing IRIs do is *if* a URI is valid UTF8 we can
display the unicode chars unescaped. 

If we think the ftp site uses iso-8859-1, but one file accidentally use
utf8, then we will display a nice name for that file, and that file
only.

As I said, this is not ideal, but it will at least never cause any
compatibility issues, and its "future proof" in that most places are
moving to utf8 (ietf/w3c recommends it for all new URI schemes). 

Also, the discussion above is only true for the absolute display names
shown in the nautilus/file selector location bar. For the filenames
displayed under each icon in a nautilus view we can correctly convert
8859-1 to utf8, because in these cases we keep the real filename around
for when we do operations on the file.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a fast talking native American hairdresser with a winning smile and a way 
with the ladies. She's a hard-bitten bisexual barmaid from aristocratic 
European stock. They fight crime! 




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