urlencoding
A tiny, zero-dependency Rust crate for percent-encoding and decoding URL paths and arguments.
Repository Health
Technical Analysis
urlencoding is a minimal Rust library for percent-encoding and decoding URLs. It encodes everything except alphanumerics and the unreserved characters -, _, ., ~, and follows the WHATWG URL standard for error recovery when decoding incomplete percent-escapes.
The crate returns Cow<str> from its encode/decode functions to avoid heap allocation when no transformation is needed, and provides a decode_binary variant for handling arbitrary bytes and invalid UTF-8. It has no runtime dependencies and is widely used as a lightweight building block in web-facing Rust crates.
What You Get
- encode() and decode() functions for percent-encoding/decoding UTF-8 strings
- decode_binary() for decoding into arbitrary bytes, tolerating invalid UTF-8
- Cow<str>/Cow<[u8]> return types that avoid allocation when no encoding/decoding is needed
- WHATWG URL standard-compliant error recovery for malformed percent-escapes
- Zero runtime dependencies, keeping the crate lightweight for embedding in other libraries
Common Use Cases
- Encoding query parameters or path segments before building a URL
- Decoding percent-encoded query strings or form data received from an HTTP request
- Sanitizing user-supplied strings for safe inclusion in a URL
- Handling arbitrary byte payloads embedded in percent-encoded data via decode_binary
Under The Hood
Architecture - The crate is split across three small modules: enc.rs implements percent-encoding, dec.rs implements decoding (both string and binary variants), and lib.rs re-exports the public API and documents usage; total implementation is under 400 lines, keeping the surface area minimal and auditable. Tech Stack - Pure Rust (edition 2021) with zero runtime dependencies, using only std::borrow::Cow from the standard library to avoid unnecessary allocations; a benches/ directory holds Criterion-based benchmarks for encode/decode performance. Code Quality - The codebase is small enough to review in full; the maintainer (kornelski, known for numerous foundational Rust crates like pngquant/rgb) marks it with a ‘maintenance: as-is’ badge, signaling it is considered functionally complete rather than unmaintained — commits have been infrequent since 2024 because the API is stable. API Design - The API surface is deliberately minimal: encode(), decode(), and decode_binary() are the only entry points, each documented with runnable examples in the README, making adoption essentially zero-friction.
Used by 23 apps in this directory
OpenBB
Analytics · Databases · Invoicing Finance
The AI Workspace for Finance: Connect Data, Run AI Agents, Build Analytics
PeerDB
Data Engineering · Databases
Postgres-native ETL that streams change data capture in real time to Snowflake, BigQuery, ClickHouse, S3, and Kafka — up to 10x faster than general-purpose pipelines, managed through a familiar Postgres SQL interface.
PostHog
Ab Testing Experimentation · Analytics · Developer Tools
The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.
Readur
Bookmarks Archiving · File Storage · Knowledge Management
A self-hosted document management system that OCRs, indexes, and makes every PDF, scan, and Office file instantly searchable.
Rivet
AI Agents · Developer Tools
Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.
Shadowbroker
Analytics · Monitoring · Security
Self-hosted OSINT dashboard that fuses 60+ live intelligence feeds — flight tracking, ship AIS, satellites, CCTV, seismic and radio networks — into one real-time map, with an agent-ready command channel for AI co-analysts.
Stirling PDF
Digital Signiture · Productivity
The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.
Svix
Automation · Developer Tools
Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.
Tabby
AI Code Assistants
Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.