URL Encode is a process of translating unprintable characters or characters with special meaning in the URL’s to an unambiguous representation. A URL(Uniform Resource Locator) is a web address. A URL can composed of words i.e(w3codingschools.com) or an IP(Internet Protocol) address i.e 195.203.64.72.
Most of the users prefer URL in the form of words because it is easy to remember than numbers.
When browser request pages from the web server at that time URL is used to address a document on the web.
Syntax:
scheme://prefix.domain:port/path/filename
Explanation of Syntax:
The scheme identifies the type of Internet service (most common is http or https).
The prefix identifies a domain prefix (default for http is www).
The domain identifies the Internet domain name (like w3codingschools.com).
port identifies the port number at the host (default for http is 80).
The path identifies a path at the server (If omitted: the root directory of the site).
The filename identifies the name of a document or resource.
Following is a list of some common Common URL Schemes:
- http(HyperText Transfer Protocol): Common web pages. Not encrypted
- https (Secure HyperText Transfer Protocol): Secure web pages. Encrypted
- ftp(File Transfer Protocol): Downloading or uploading files
- file: A file on your computer
HTML URL Encode:
URL encoding is the process of converting non-ASCII characters into a format that can be transmitted over the Internet because a URL is sent over the Internet by using the ASCII character-set only.
If the URL has characters outside the ASCII set, it has to be converted.
In URL encoding non-ASCII characters are replaced with a “%” followed by the hexadecimal digits.
URLs cannot contain spaces. URL encoding replaces a space with a plus (+) sign, or %20.
List of some character sets which are encoded by the browser after submitting the text:
Character | From Windows-1252 | From UTF-8 |
---|---|---|
€ | %80 | %E2%82%AC |
£ | %A3 | %C2%A3 |
© | %A9 | %C2%A9 |
® | %AE | %C2%AE |
À | %C0 | %C3%80 |
Á | %C1 | %C3%81 |
 | %C2 | %C3%82 |
à | %C3 | %C3%83 |
Ä | %C4 | %C3%84 |
Å | %C5 | %C3%85 |