for example if we have something like this:
why not replace all the +
with a space
? does the browser read the URL differently?
for example if we have something like this:
why not replace all the +
with a space
? does the browser read the URL differently?
The URI format, which is used by the HTTP protocol, does not allow spaces in URLs.
See RFC 2396 section 2.4.3
I don't fully get what you mean but space decodes as %20 in the address bar '+' is more intuitive - many non-alphanumeric characters are NOT part of any url encoding standard
RFC 1738 reports that spaces are not allowed in a URL. Internet Explorer is notoriously relaxed in its requirements for encoding spaces.
The +
indicates that the space character it represents is significant, because they're not in the URI spec (RFC 1738, section 2.2).
More specifically:
Characters can be unsafe for a number of reasons. The space
character is unsafe because significant spaces may disappear and
insignificant spaces may be introduced when URLs are transcribed or
typeset or subjected to the treatment of word-processing programs.
Basically, in a HTTP packet, a space indicates the end of the URL.
A typical HTTP request would look like this:
GET /path/index.htm?id=123 HTTP/1.1
That's all one line with spaces separating the fields, and a CRLF at the end (with more stuff following on the next line).
Plus sign is one of the encodings for space in a URL. The other is %20, which is the hex equivalent of the space character. More to the answer that Slaks gave: it's a real good idea to encode material in the query string. That's the part of the URL you're asking about -- everything after the question mark.
The encoding in this example is incomplete and not too good: the ampersands in "...&chs=640x465&cht=bvs&chco=A2C180&chds=0,129.8&..." and elsewhere should be encoded as '&'
-- b