Expand description
A Rust port of Punycode (RFC 3492), the ASCII-compatible encoding at the heart of
Internationalized Domain Names — e.g. münchen <-> mnchen-3ya.
Port target: Python’s standard library encodings/punycode.py (Martin v. Löwis).
Verified against Python’s built-in punycode codec.
The algorithm separates a string into its ASCII “base” and its sorted non-ASCII characters, then encodes each non-ASCII character as a single integer “delta” that records both which character and where it is inserted. Deltas are written as base-36 generalized variable-length integers with an adaptive bias that self-tunes for compactness. Decoding mirrors the process exactly.
Enums§
- Punycode
Error - An error from
decode.