How it works
Query parameters need encoding so spaces, ampersands, and non-ASCII letters do not break the URL. This page uses encodeURIComponent and decodeURIComponent, which is the right pair for a single parameter value rather than a whole URL. Decoding a broken escape sequence shows an error.