• 0

URL request


Question

Hello everybody!

I was just wondering if somebody out there has specification as what a browser does with a ' ' (space) in a URL.

I personally was under the impression, that all spaces will automatifcally converted to '%20', but apparently there are browsers out there converting a space to '+'

My questions are:

1) What is the official specification for a space in the URL

2) Is there a list about what browser replaces space with what filler ??

Thanks in advance!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
My questions are:

1) What is the official specification for a space in the URL

2) Is there a list about what browser replaces space with what filler ??

1) I thought it converted them to %20

Not sure where to find #2.

Link to comment
Share on other sites

  • 0
1) I thought it converted them to %20

Not sure where to find #2.

Apparently Opera doesn't.

I have a script on my site, that if somebody requests a non existant URL i get an email with the requested page and the browser info/ip/date time:

404 Page not found:
URL: [hidden]

IP: 174.133.[hidden]
HTTP Referer:  User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50
Date: 06/27/2009 05:47:27

Link to comment
Share on other sites

  • 0

Hex encoding is the more general form, and using %20 is the most correct way to handle this. '+' is non-standard, and can only be used in the query portion of the URL. How '+' is interpreted is dependent on the script or software running on the server side (okay, how %20 is interpreted is technically dependent on server-side stuff too, but translating %20 to a space is much more uniformly implemented than translating '+' to a space).

Generally, when decoding, you (1) locate the start of the query string, if there is one, (2) convert all '+' to spaces within the query string, and (3) decode the hex-encoded characters

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.