Know more about URL Encoding

Know more about URL Encoding

March 22, 2019
2 min read
808 views
0

Know more about URL Encoding

A URL is another word for a web address. URL can be composed of words or an IP address. Most people use the name when surfing because names are easier to remember than numbers. URL stands for Uniform Resource Locator. It's used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN).

URL encoding is the process of converting string into valid URL format. Valid URL format means that the URL contains only what is termed "alpha | digit | safe | extra | escape" characters. Most web programming languages already provide built in method to perform URL Encoding and URL Decoding. It's normally performed to convert data passed via html forms.

Where URL Encoding is the process of converting a string into a valid URL format. The valid URL format means that the URL should not contain any unprintable characters or characters with special meaning. URL Encoding helps to represent unambiguous and universally accepted characters for web browsers and servers.

The most commonly encoded character in URL string is the <space> character. You can see plus-sign (+) whenever space in a URL. The plus sign acts as a special character representing that space in a URL.

How could you encode a URL?

To encode a URL, you simply replace the special characters with their encoding string. Nearly most of the special characters encoding begin with a % character followed by a hexadecimal number.

If you don't want to do encode items by hand, you can use the predefined function found in both client and server side languages, such as encodeURI(string) - JavaScript, urlencode(string) - php, encode(string, "UTF-8") - Java etc.

What should be encoded?

Any character that is not an alphabet, a number, or a special character that is being used outside its normal context is going to need to be encoded in your page.

But, If you were writing special characters for HTML instead of URL then you need to add an ampersand, you could not use %26. Instead, you would use either "&amp;" or "&#38;", both of which would write out the & in the HTML page when rendered.

Was this article helpful?Vote to let the author know
0
Share this article

Loading comments...

Related Articles

How to Develop a BEP20 Token for Your Blockchain Project

How to Develop a BEP20 Token for Your Blockchain Project

Blockchain tokens are used across a wide range of applications, including digital platforms, decentralized finance (DeFi), gaming ecosystems, and community-driven projects. For businesses planning to launch a token on BNB Smart Chain, the BEP20 standard provides a framework for creating fungible tokens that can interact with compatible applications and services.

13 views
Read More
Read full article: How to Develop a BEP20 Token for Your Blockchain Project
Jeff Geschwind: The ASCO’s Guiding Principles for the Responsible Use of AI

Jeff Geschwind: The ASCO’s Guiding Principles for the Responsible Use of AI

The American Society of Clinical Oncology (ASCO) has served as a world-leading professional organization for physician/scientists and other oncology professionals involved in the care of patients with cancer since 1964. The ASCO maintains a depth of resources and tracks the latest oncology news, in addition to advocating for important policies and initiatives that impact the field of oncology.

21 views
Read More
Read full article: Jeff Geschwind: The ASCO’s Guiding Principles for the Responsible Use of AI
Axi (formerly AxiTrader) alternatives: four brokers to compare

Axi (formerly AxiTrader) alternatives: four brokers to compare

Guide to compares four brokers against Axi using only the details each firm publishes on its own website, starting with the one that matches Axi's app, MetaTrader and copy trading set-up while adding markets Axi's international site doesn't list.

9 views
Read More
Read full article: Axi (formerly AxiTrader) alternatives: four brokers to compare