W3C home > Mailing lists > Public > www-validator@w3.org > June 2001

Re: Flagging & in URL in HTML 4.01 transitional type.

From: Peter K. Sheerin <pete@petesguide.com>
Date: Fri, 8 Jun 2001 12:36:08 -0700
Message-ID: <002d01c0f052$45241130$9865fea9@cadencesheerin>
To: <www-validator@w3.org>
I recently had to adress this issue in trying to make a bunch of ad banner
calls validate, and I think there's a better way of escaping the ampersand
character.

While the use of &amp; for escaping (and &#32;) it theoretically works, I
have found that not all browsers correctly handle such URLs when pasted into
the address field.

What I have found seems to work reliably (though through admittedly limited
testing) is the first method of escaping characters in URLs that I was
taught years ago--the %hex encoding. This is in the HTML 4.01 spec at
http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.

So now I use %26 instead to insert an ampersand in a URL. This seems to work
reliably with the server-side scripts and in the URL address box of all
browsers.

I have seen some scripts that support the use of the question mark as the
separator, but the HTML 4.01 spec actually suggests the use of the
semicolon:

http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2

----- Original Message -----
From: "Peter Foti (PeterF)" <PeterF@SystolicNetworks.com>
To: <www-validator@w3.org>
Sent: Friday, June 08, 2001 11:13 AM
Subject: FW: Flagging & in URL in HTML 4.01 transitional type.

> Therefore, to display an &, we escape it with &amp;
Received on Friday, 8 June 2001 15:36:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:58 GMT