filenameFromUri

Converts an escaped ASCII-encoded URI to a local filename in the encoding used for filenames.

Since GLib 2.78, the query string and fragment can be present in the URI, but are not part of the resulting filename. We take inspiration from https://url.spec.whatwg.org/#file-state, but we don't support the entire standard.

string
filenameFromUri
(
string uri
,
out string hostname
)

Parameters

uri string

a uri describing a filename (escaped, encoded in ASCII).

hostname string

Location to store hostname for the URI. If there is no hostname in the URI, null will be stored in this location.

Return Value

Type: string

a newly-allocated string holding the resulting filename, or null on an error.