url

Why do you need to encode spaces in URLs?


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?


Solution

  • 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.