Introduction to HTML URL Encoding
In this article, we are going to learn about HTML URL Encoding in detail. HTML URL is an acronym of Uniform Resource Locator to global or IP address on the World Wide Web. Web server gets the page using URL for the web browser.
Example: https://www.google.com is one of the URL.
ASCII character set is important for HTML URL Encoding. URL is sent to the internet using the ASCII Character set. Non-ASCII character is restricted because of they may create conflict to find page path to the server. Because of this problem, HTML uses URL Encoding.
HTML URL Encoding, convert the Non-ASCII character into a format that can send to the internet. Users can be converted using “%” to continue with two hexadecimal digits.
How to Perform URL Encoding in HTML?
- HTML language creates URL using <a> tag and href attribute. For Example <a href=https://www.google.com/>. if you make any website and want to go from one page to another, then write the file name. <a href=”page1.html”>.
- Some characters are restricted to web address name because of conflict creation; non-ascii character replaces with “% ” to continue with two hexadecimal digits.
- URL does not hold space. It takes the place of the plus sign (+) or %20. In the form of the HTML page, space occurred in “input” text output, then plus sign shows. Indirectly space occurred in URL name then %20 shows.
- URL tag contain the uppercase letters(A- Z), and lowercase letters(a- z), decimal digits(1-9) and some special characters.
In the form, if I put space, then the URL Encoding comes as HTML+CSS.
<a href=”my file.html”>
In any URL, if we give space, then URL Encoding will occur as my%20file.html.
- Reserved Characters: There are some characters with some meaning in the URL address, and we can use naming purpose. We can use both ways, like plus (/) sign used for a separate part of URL another hand, we can / encode by %2f without meaning in the name of address.
- Unsafe Characters: Many characters come with many misunderstandings in the URL address, like space in the URL name. Instead of take space in URL address name <a href=”pa ge.html”>, write <a href =”pa%20ge.html”>. then the URL name seems “pa ge.html”.
- Non-ASCII Control Characters: These Characters Are Including the Set of An 80-Ff Hex Value, Which Is a Need to Convert in Format.
- ASCII Control Characters: There Are Not Working Inside of URL.
Examples of HTML URL Encoding
Following are the examples of HTML URL Encoding explained in detail: Popular Course in this categoryHTML Training (12 Courses, 19+ Projects, 4 Quizzes)12 Online Courses | 19 Hands-on Projects | 89+ Hours | Verifiable Certificate of Completion | Lifetime Access | | 4 Quizzes with Solutions
4.5 (6,502 ratings)Course Price
₹6999 ₹41999
View Course
Related CoursesBootstrap Training (2 Courses, 6+ Projects)XML Training (5 Courses, 6+ Projects)CSS Training (9 Courses, 9+ Projects)
1. Reserved Characters Encoding
Following is the Table Utilized for Encoding Reserved Characters.
Characters | $ | & | + | , | / | : | ; | = | ? | @ |
URL Encode | 24% | 26% | %2b | %2c | %2f | %3a | %3b | %3d | %3f | 40% |
2. Unsafe Characters
Following is the Table Utilized for Encoding Unsafe Characters.
Characters | space | “ | < | > | # | % | { | } | | | \ | ^ | ~ | [ | ] |
URL Encode | 20% | 22% | %3c | %3e | 23% | 25% | %7b | %7d | %7c | %5c | %5e | %7e | %5b | %5d |
3. Non-ASCII Control Character
Following is the Table Utilized for Encoding Non-ASCII Characters.
Character | URL Encode | Character | URL Encode | Character | URL Encode | Character | URL Encode |
€ | %80 | ˜ | %98 | « | %ab | ¿ | %bf |
‚ | %82 | ™ | %99 | ¬ | %ac | À | %c0 |
ƒ | %83 | š | %9a | ª | %aa | Á | %c1 |
„ | %84 | › | %9b | ® | %ae | Â | %c2 |
… | %85 | œ | %9c | ¯ | %af | à | %c3 |
† | %86 | | %9d | ° | %b0 | Ä | %c4 |
‡ | %87 | ž | %9e | ± | %b1 | Å | %c5 |
ˆ | %88 | Ÿ | %9f | ² | %b2 | Æ | %v6 |
‰ | %89 | × | %d7 | ³ | %b3 | Ç | %c7 |
Š | %8a | ¡ | %a1 | ´ | %b4 | È | %c8 |
‹ | %8b | ¢ | %a2 | µ | %b5 | É | %c9 |
Œ | %8c | £ | %a3 | ¶ | %b6 | Ê | %ca |
Ž | %8e | ¤ | %a4 | · | %b7 | Ë | %cb |
‘ | %91 | ¥ | %a5 | ¸ | %b8 | Ì | %cc |
’ | %92 | ¦ | %a6 | ¹ | %b9 | Í | %cd |
“ | %93 | § | %a7 | º | %ba | Î | %ce |
” | %94 | ¨ | %a8 | » | %bb | Ï | %cf |
• | %95 | © | %a9 | ¼ | %bc | Ð | %d0 |
– | %96 | — | %97 | ½ | %bd | Ñ | %d1 |
ã | %e3 | Þ | %de | ¾ | %be | Ò | %d2 |
æ | %e6 | ß | %df | Ø | %d8 | Ó | %d3 |
ä | %e4 | à | %e0 | Ý | %dd | Ô | %d4 |
4. ASCII Control Characters
Following is the Table Utilized for Encoding Ascii Characters.
ASCII Character | URL-Encoding |
NUL – null character | %00 |
SOH – the start of the header | %01 |
STX – the start of the text | %02 |
ETX – end of the text | %03 |
EOT – end of the transmission | %04 |
ENQ – enquiry | %05 |
ACK – acknowledge | %06 |
BEL – bell (ring) | %07 |
BS – backspace | %08 |
HT- horizontal tab | %09 |
LF- line feed | %0A |
VT- vertical tab | %0B |
FF- form feed | %0C |
CR- carriage return | %0D |
SO- shift out | %0E |
SI- shift in | %0F |
DLE- data link escape | %10 |
DC1- device control 1 | %11 |
DC2- device control 2 | %12 |
DC3- device control 3 | %13 |
DC4- device control 4 | %14 |
NAK- negative acknowledge | %15 |
SYN- synchronize | %16 |
ETB- end transmission block | %17 |
CAN- cancel | %18 |
EM – end of medium | %19 |
SUB- substitute | %1A |
ESC- escape | %1B |
FS -file separator | %1C |
GS- group separator | %1D |
RS- record separator | %1E |
US- unit separator | %1F |
Importance of URL Encoding in HTML
If the URL is reserved, Unsafe, and Not ASCII Characters, then the URL address becomes more complicated and not understandable. When a web browser searches URL addresses, the Web Server searches the name or path of the URL. If the URL name is not ASCII, then it is difficult to find the URL Importance of URL Encoding in HTML.
URL address must be easy to find, universally accepted and understandable for all web browsers and also a web server. Some characters are making misunderstandings in URL because they are used for some purpose if it is not used for any purpose. That time conflict might have occurred, and the path does not get to the user.
To overcome all difficulties and make easy to user Non-ASCII characters converted into ASCII code using % to come up with two hexadecimal.
Conclusion
URL Encoding in HTML knows how to convert the Non-ASCII set of characters to a valid ASCII set of format. It is universally accepted, and a web browser works without any error. Encoding URL’s can be run on easily and safely. To avoid conflict of naming and purpose of naming, URL encoding is necessary.
Recommended Articles
This is a guide to HTML URL Encoding. Here we discuss the introduction of HTML URL and how to perform URL Encoding in HTML along with its examples and importance. You may also look at the following articles to learn more-