Encode() Function

The encode() function encodes the special characters in the input string to the URL-encoded characters.

For example, if a string contains the backspace character , the encode () function encodes it to the %08 character.