Encode or decode a URL or query string.
URL encode and decode utility. Applies percent-encoding (encodeURIComponent) or full URI encoding (encodeURI), and their decode counterparts. Also supports form-encoding (application/x-www-form-urlencoded).
encodeURIComponent encodes all characters except unreserved (A-Z, a-z, 0-9, -, _, ., ~) per RFC 3986. encodeURI additionally preserves URI structural characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =). Form encoding replaces spaces with + and applies percent-encoding per the HTML living standard's application/x-www-form-urlencoded serialiser. Decode operations use the corresponding decodeURI/decodeURIComponent functions.