• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Percent-encoding and URL Encode/Decode

By Abhishek Ghosh October 4, 2013 6:42 am Updated on October 4, 2013

Percent-encoding and URL Encode/Decode

Advertisement

Percent-encoding or URL Encoding is a mechanism to provide information in an URL under certain circumstances to ensure only certain ASCII characters are used. This is important for Application, Plugin development, SEO Purposes and for the Webmasters. Unfortunately enough, this Percent-encoding or URL Encoding is given much lesser weight than it deserves. Actually the peoples who are around the backbone of Internet are very less in number and with the advent of consumer grade Blogs ‘Popular’ blogs on Internet, these information are never passed to the general consumer or prosumer grade Internet Users. Without this Percent-encoding or URL Encoding some information could not be expressed in a URL. For example, a space in the browser usually interpreted as the end of the URL, the next following signs are ignored or cause an error. When we share an URL, for example you Retweet this article, they are converted to Percent-encoded or URL Encoded form. You can try by clicking the Twitter button below this article and notice the full set on address bar – its not necessary to hit the Retweet button, just observe the set in the pop up window. That is what Percent-encoding or URL Encoding we are talking about.

 

Percent-encoding and URL Encode/Decode : Basics

 

With URL encoding a space can be passed by the string %20. RFC 3986 defines a standard as a URI (and therefore also a URL) should be constructed syntactically and under what conditions the URL encoding is applied. The character which are not included in the ASCII character set, for the sake of representation, in URL encoding the percent sign used. There is however so far only one recommendation in RFC 3986, a mandatory standard is still missing. It is important to note the two phrases – Uniform Resource Locator (URL) and Uniform Resource Identifier (URI).

URL Encoding in fact, generally  is more used within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN). As such, it 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 or in HTTP requests. So, we need certain mechanism for the conversion. This is the basic principle behind Percent-encoding or URL Encoding.

Advertisement

---

 

Percent-encoding and URL Encode/Decode : Reserved and Non-reserved Characters

 

Percent-encoding and URL Encode-Decode

URLs can contain a maximum of the following fields:

Vim
1
http://username:passwd @ www.example.net:8080/index.html?action=something&session=A54C6FE2 # info

Certain characters identified within this expression and separate the various segments of the URL and allow disassembly and processing of expression. In a HTTP access, for example some processing like:

  1. Direction of the question mark (?) the data part ( query string ) of the URL
  2. Appending the equal sign (=) between the name of a parameter and its value
  3. Appending the ampersand (&) as delimiters between “parameter = value” elements in the data section
  4. Appending the hash (#) as the name of a document anchor (see also URI reference linked above)

are required.

Other characters have specific meanings in the document path . Altogether, the following characters are considered to be reserved:

Vim
1
! # $% & '() * +, /:; =? @ []

 

The following characters (groups) are not reserved, so have no predefined meaning in a URL:

 

Vim
1
Letters [AZ, az], numbers [0-9] and  - _. ~

 

However, the rules are not always strictly followed.

 

Percent-encoding and URL Encode/Decode : Tools

 

Now, coming to the practical part, the needed free tools for this percent-encoding and URL encode/decode work. PHP has own function :

 

Vim
1
http://php.net/manual/en/function.rawurlencode.php

 

This simply means, in WordPress or other CMS, we need not to depend on third party server, a plugin can make an URL suitable to be shared to Twitter (for example) by following the extra parameters needed to be added, thats why there is guide by Twitter :

 

Vim
1
https://dev.twitter.com/docs/auth/percent-encoding-parameters

 

But, these are actually never followed by the primarily Front End developers resulting in including too many Javascripts in the web pages. Here is a Command Line PHP based simple tool :

 

Vim
1
https://github.com/AbhishekGhosh/URLize

 

There are Java, Javascript, Ruby, Python, Apache Modules ways too.

Tagged With percent encoding , percent-encoding , url percent encoding , %IMAGEURL% , percent encode ampersand & , url to percent encoding dynamic parameter , online percent encode decode , long url percent encoding , interpreting percent encoding , how to url encode the percent sign in php
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Percent-encoding and URL Encode/Decode

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • URI and URL : Uniform resource locator and Uniform Resource Identifier

    URI and URL are often interchangeably used. However, technically there are some differences between Uniform resource locator and Uniform Resource Identifier.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy