What is URL percent-encoding?
Defined in RFC 3986, percent-encoding replaces unsafe ASCII characters and non-ASCII bytes with a '%' followed by their two-digit hexadecimal value.
Encode special characters into percent-encoded URI strings and decode encoded query parameters safely with full UTF-8 and component encoding support.
Defined in RFC 3986, percent-encoding replaces unsafe ASCII characters and non-ASCII bytes with a '%' followed by their two-digit hexadecimal value.
Use encodeURI when encoding a complete URL (preserving http:// and slashes). Use encodeURIComponent when encoding individual parameter values so query delimiters like '=' and '&' do not corrupt query parsing.