filenameToUri

Similar to glib.global.filenameToUri, but attempts to handle relative file paths as well. Before converting filename into an URI, it will be prefixed by the current working directory if it is a relative path, and then the path will be canonicalised so that it doesn't contain any './' or '../' segments.

On Windows filename should be in UTF-8 encoding.

string
filenameToUri
(
string filename
)

Parameters

filename string

absolute or relative file name path

Return Value

Type: string

newly-allocated URI string, or NULL on error. The caller must free the URI string with glib.global.gfree when no longer needed.