fileuri

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fileuri is the percent-encoding and file:// URI handling lys-shell's portal, clipboard and VPN code share.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) []byte

Decode resolves %XX escapes to bytes. A % that does not begin a valid escape is kept as written rather than dropped: it is a literal percent sign in a filename or a cookie, and losing it silently corrupts the value.

func DecodeString

func DecodeString(s string) string

DecodeString is Decode with invalid UTF-8 replaced, as Rust's from_utf8_lossy does.

func Encode

func Encode(s, keep string) string

Encode keeps RFC 3986's unreserved bytes and those in keep, and escapes the rest.

func FromPath

func FromPath(path string) string

FromPath is the file:// URI of an absolute path, as g_filename_to_uri (and so gio and the thumbnail spec) writes it: glib's path-safe sub-delimiters stay literal.

func Path

func Path(uri string) (string, bool)

Path decodes a file:// URI's path, dropping any authority (file://host/path); another scheme, or a file URI with no path, is not a path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL