By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

Double quotation mark within a URL

P: n/a
Hi!

Is using of a double quotation mark with a URL a problem? For example:

http://myserver.com/query?field1=something&field2=test&params="field1= test1"+"field2=test2"

Regards
Thomas
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Thomas Miskiewicz wrote:
Is using of a double quotation mark with a URL a problem?


Yes, you have to encode it as %22

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2

P: n/a
On Mon, 9 Feb 2004, Thomas Miskiewicz wrote:
Is using of a double quotation mark with a URL a problem? From the fact that you're asking, it seems that the answer is "yes" - what happened when you tried it?
For example:

http://myserver.com/query?field1=something&field2=test&params="field1= test1"+"field2=test2"


I'd strongly recommend you get to grips with the rules of
application/x-www-form-urlencoded - you'd be advised to mimic those
if you're trying to compose your own GET-style URLs.

Funnily enough, this is defined in the HTML specification[1] and thus
seems to be on-topic here, though I'd suspect that decoding it at the
server is more apt to be discussed on c.i.w.a.cgi (beware the
automoderation bot).

[1] http://www.w3.org/TR/html401/interac...ml#h-17.13.4.1

good luck
Jul 20 '05 #3

P: n/a
"Thomas Miskiewicz" <mi*********@yahoo.com> wrote:
Is using of a double quotation mark with a URL a problem?
I would have appreciated your telling me that you were also asking this
in public when we had our E-mail conversation. I don't particularly
fancy the task of copy & paste in vain.
http://myserver.com/query?field1=something&field2=test&params="field
1=test1"+"field2=test2"


It is not a correctly formed URL.

Here's what I E-mailed, in reply to "Can you tell me where do I find a
prove, that double quotation marks are allowed in a URL?"

You don't; they aren't.

The authoritative reference in generic URL syntax is currently RFC
2396,
which is available as hypertext at
http://www.cs.tut.fi/~jkorpela/rfc/2396/
but beware that the authoritative version is the plain text version in
official RFC repositories.

RFC 2396 explicitly declares the quotation mark as "excluded" in clause
2.4.3. Exclusion means that it may only appear in escaped form, as %22.
The reason given doesn't sound very strong:
"The angle-bracket < and > and double-quote " characters are excluded
because they are often used as the delimiters around URI in text
documents
and protocol fields."
But the statement is very clear.

And after you asked whether you should convert " to %22, I replied:

Why not? That's the right way.

Regarding "What problem can this cause?":

No idea. I would just do it the right way. Of course, if you put the
URL into an HTML document, then you surely need to consider it (but
then you should also escape the & characters). Other than that, I see
no reason why programs would fail to pass the quotation marks. But "be
liberal in what you receive, conservative in what you send".

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #4

P: n/a
"Thomas Miskiewicz" <mi*********@yahoo.com> wrote in message
news:c0**********@news.gatel.net...
Hi!

Is using of a double quotation mark with a URL a problem? For example:

http://myserver.com/query?field1=something&field2=test&params="field1= test1"+"field2=test2"


If you have the option of using ASP, you can do this easily with the
Server.URLEncode method. Of course, that requires some server-side
processing, but I thought I would mention it.

Regards,
Peter Foti
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.