'file' URI scheme
Alexander Larsson
alexl at redhat.com
Mon Mar 31 04:18:04 PDT 2008
On Mon, 2008-03-31 at 12:06 +0100, Thiago Macieira wrote:
> KDE 4.0 does not support non-UTF-8 locales. The reason is that we keep all
> filenames in Unicode form (UTF-16). Until recently, we had no API to extract
> the raw, percent-encoded path from a URL -- the only way was the UTF-16
> QUrl::path() function. Even now, this would lead to code like:
>
> if (url-protocol is "file") {
> percent-encoded ← url.percent-encoded-path
> byte-stream ← percent-decode(percent-encoded)
> path ← decode-according-to-locate(byte-stream)
> } else {
> path ← url.utf16-path
> }
>
> We have no plans of implementing that support.
This is not quite how it works in gnome (actually glib). We separate the
filename encoding from the locale encoding. You can set environment
variables to specify an explicit filename encoding (independent of
locale) or you can set it to follow the locale.
Anyway, doesn't this cause you problem in e.g. the file manager when you
stumble over such a file and want to rename it to something sane? Well,
I guess it works fine as long as you use uri:s instead of paths.
More information about the xdg
mailing list