Percent-encoding and decoding

Percent-encoding, or URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). Every "unsafe" character is represented in the form '%HH' or with a longer escape sequence (where H is as hexadecimal digit '0' ... 'F').

Actually, every reserved or non-ASCII (including UCS-2 or UCS-4) character

Percent encoding is also used in the preparation of data of the application/x-www-form-urlencoded media type, as is often used in the submission of HTML form data in HTTP requests.

The '%uHHHH' escape sequences defined in MS JScript but not in RFC3986 are also recognized by the percent-decode function.

The functions described in this section are also called directly in YHTML-Template code.