urlendec
A command-line URL encoder/decoder.
Features
- Encode or decode percent-encoded URLs
- Read from a file or stdin, write to a file or stdout
- Processes input line-by-line
- Single static binary — no runtime dependencies
Installation
From crates.io
From source
The binary is placed at target/release/urlendec.
Pre-built binaries
Download a binary for your platform from the releases page:
- macOS Intel (
x86_64-apple-darwin) - macOS Apple Silicon (
aarch64-apple-darwin) - Linux musl static binary (
x86_64-unknown-linux-musl)
Usage
Encode a string:
$ urlendec -s "Hello, world!"
Hello%2C%20world%21
Decode a string:
$ urlendec -d -s "Hello%2C%20world%21"
Hello, world!
Encode from stdin:
$ echo "Hello, world!" | urlendec
Hello%2C%20world%21
Encode a file and write to another file:
Decode a file to stdout:
Options
| Flag | Description |
|---|---|
-d, --decode |
Decode input instead of encoding (default is encode) |
-s, --string <STRING> |
Encode/decode a literal string (mutually exclusive with -i) |
-i, --input-file <PATH> |
Read line-by-line from a file (default: - = stdin) |
-o, --output-file <PATH> |
Write output to a file (default: - = stdout) |
-h, --help |
Print help information |
-V, --version |
Print version information |
Building from source
Contributing
Contributions are welcome. See CONTRIBUTING.md for setup instructions, style guidelines, and the PR process.
License
This project is licensed under the MIT License. See LICENSE for details.