Codec lesson · URL Percent
URL Percent: encode UTF-8 octets for a URI component
RFC 3986 percent encoding writes an octet as % followed by two hexadecimal digits. Encode Keyboard leaves only unreserved URI characters literal and encodes everything else byte by byte.
Completed in this browser
Identify RFC 3986 unreserved characters, encode UTF-8 bytes with uppercase %HH triplets, and avoid form-style + handling.
Letters, digits, -, ., _, and ~ remain literal. Every other UTF-8 byte becomes an uppercase %HH triplet. Spaces therefore become %20, never + in this profile.
How Encode Keyboard handles it
Convert text to UTF-8 octets
Non-ASCII characters may produce several bytes and therefore several %HH triplets.
Leave unreserved characters alone
Only ALPHA, DIGIT, -, ., _, and ~ remain literal.
Validate a canonical meaning
Decode accepts upper- or lowercase hex in complete triplets, normalizes it to uppercase, and rejects raw reserved characters or invalid UTF-8 bytes.
Worked example
Xin chàoXin%20ch%C3%A0oThe space is %20; à is UTF-8 bytes C3 A0 and therefore becomes %C3%A0.
Good uses
- Learning how URI component bytes are represented
- Inspecting percent-encoded UTF-8 text
- Preparing non-sensitive text for a documented URI-component context
Validation and common errors
- The encoder writes uppercase %HH; the decoder also accepts lowercase hex in complete triplets
- Encode a literal % as %25 and a space as %20
- Do not use + as an alias for a space in this RFC 3986 profile
Practice in your browser
This uses the same documented rules as the app and runs only in this tab.