rune-url-encode 0.2.0

URL percent-encoding and decoding for byte slices and strings
Documentation
  • Coverage
  • 75%
    9 out of 12 items documented5 out of 6 items with examples
  • Size
  • Source code size: 13.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 355.72 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • alexile/runes
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • alexile

rune-url-encode

URL percent-encoding and decoding for byte slices and strings.

crates.io docs.rs license CI

What it does

Encodes strings as percent-encoded (%XX) sequences and decodes them back. Uses the RFC 3986 unreserved character set — all other bytes are escaped. Decoding also accepts + as a space (application/x-www-form-urlencoded).

Installation

[dependencies]
rune-url-encode = "0.1"

Usage

use rune_url_encode::{encode, decode};

let encoded = encode("hello world/path?q=1");
assert_eq!(encoded, "hello%20world%2Fpath%3Fq%3D1");

let decoded = decode(&encoded).unwrap();
assert_eq!(decoded, "hello world/path?q=1");

CLI

rune-url-encode "hello world"       # encode
rune-url-encode -d "hello%20world"  # decode
echo "hello world" | rune-url-encode -  # stdin

Output

hello%20world

License

MIT