Why do you need to encode urls? Is there a good reason why you have to change every space in the GET data to %20?
From RFC 2936, section 2.4.3:
The space character is excluded because significant spaces may disappear and insignificant spaces may be introduced when URI are transcribed or typeset or subjected to the treatment of word- processing programs. Whitespace is also used to delimit URI in many contexts.
Since URLs often contains characters outside the ASCII set, the URL has to be converted. URL encoding converts the URL into a valid ASCII format.
Therefore URL encoding converts characters into a format that can be safely transmitted over the Internet.
URLs can only be sent over the Internet using the ASCII character-set.
URL encoding replaces unsafe ASCII characters with "%" followed by two hexadecimal digits corresponding to the character values in the ISO-8859-1 character-set. URLs cannot contain spaces. URL encoding normally replaces a space with a + sign
Well, you do so because every different browsers knows how the string that makes up the URL is encoded. converting the space to %20, etc makes that URL/URI portable. It could be latin-1 it could be unicode. It needs normalized to something that is understood universally. Take a look at rfc3986 http://tools.ietf.org/html/rfc3986#section-2.1