URL's with percent signs??? Why?

Sometimes I'll copy a URL and it will contain percent signs and numbers.  Other times it won't  Why is this?
brothertruffle880Asked:
Who is Participating?
 
Jeff DarlingDeveloper AnalystCommented:
The percent signs and numbers are url encoded strings.

URL Encoding replaces unsafe characters with % followed by their hex equivalent. That hex equivalent is the HEX value for the character being replaced.
0
 
Tom BeckCommented:
Detailed explanations all over the internet like this one. Includes a list of encoded characters:

http://www.w3schools.com/tags/ref_urlencode.asp
0
 
Mark BullockQA Engineer IIICommented:
This encodes characters in the URL as number. Often these are reserved characters.
For example, let's say I wanted to pass a query parameter, answer, with a value of "a&b".
Your URL might look like:
http://yourdomain.com/?answer=a&b.
Things would be confusing because the ampersand character has a special meaning (it separates two query parameters). So there are two query parameters in your URL: answer and b.
But you intended to send one query parameter.

So you URL encode the value to avoid this.
http://yourdaomin.com/?answer=a%26b
0
 
Jason C. LevineNo oneCommented:
Another common example:

http://domain.com/this%20is%20a%20bad%20idea.html/

%20 is a space:

http://domain.com/this is a bad idea.html
0
 
Dave BaldwinFixer of ProblemsCommented:
I like the explanation on this page: http://en.wikipedia.org/wiki/Percent-encoding
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.