Encode and decode URL components, like query string values with spaces and special characters.
Encoding uses encodeURIComponent() and decoding uses decodeURIComponent() - the same functions used when building query strings in JavaScript. Malformed % sequences are caught and reported instead of crashing.