[Nautilus-list] Re: location bar autocompletion



On 2/25/02 2:26 PM, "Alex Larsson" <alexl redhat com> wrote:

> What is the current assumptions about the encoding of gnome-vfs URIs?

It's very tricky. Basically, if you are working with a URI, it's very hard
to tell what the encoding is. You have to use whatever encoding that's used
by the server that you are talking to. The URI spec says that it's always
UTF-8, but that's not right in practice. But your other comments show you
already understand this.

> Naturally escaped ones should be treated as ASCII only, but what happens
> when you unescape them. How do we display them in e.g. nautilus? We can't
> really rely on them being UTF8, since that might not work for non-file
> URIs. 

The fallback is to display the URI with encoded entities. There's really no
"unescaping" of a URI. There's just a "display certain URIs in a nicer
looking way" that doesn't necessarily have to work for every single URI.

> In general, Gtk+ 2 / Gnome 2 treats local filenames as always in UTF8,
> unless the G_BROKEN_FILENAMES environment variable is set.
>
> Darin, how have you hadled these kinds of issues in nautilus before?

The general rules were:

    1) try to display a URI in "nice" form in the location bar -- this means
leaving off "file://" for example
    2) make sure that anything done to the URI is completely reversible
    3) allow heuristics to be used

So basically, we can make URIs look nice in the location bar in any way that
works on most URIs, and is reversible. We could have the rule for decoding
local files in the location bar be controllable with G_BROKEN_FILENAMES if
you like.

Note that a separate closely related issue is the names displayed underneath
icons and elsewhere. These come from nautilus_file_get_display_name. These
can also respect G_BROKEN_FILENAMES. But we can also make decisions based on
whether names decode as UTF-8, and add parenthetical comments and do other
tricks, because the heuristic here doesn't have to be reversible.

    -- Darin





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