why we need to url encoding?

0 votes
2,079 views
asked Jan 3, 2013 in HTML by Chanakya (545 points)
i dont know why we need urlencodeing...In my currnt project some one using the url encodeing

i want use the urlencoding in php with js?

1 Answer

0 votes
answered Jan 3, 2013 by anonymous

                  Because some characters have special meanings. For instance, in a query string, the ampersand (&) is used as a separator between key-value pairs. If you were to put an ampersand into one of those values, it would look like the separator between the end of a value and the beginning of the next key. So for special characters like this, we use percent encoding so that we can be sure that the data is unambiguously encoded.

 

encodedUrl = URLEncoder.encode(urlToEncode,"UTF-8");

...