Forum Moderators: open

Message Too Old, No Replies

Encoding Urls

what else needs to be done?

         

HelenDev

9:58 am on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Going through some pages and checking validation, SiteMorse errors etc., and have got to the subject of URL encoding.

I know that ampersands need to be encoded or you will get a validation error, but is there anything else which does as well?

Some of my URLs have equals signs in them which doesn't cause them to fail validation, but I've read somewhere that equals signs should be encoded too.

SiteMorse has also given some sort of error relating to equals sign, although I can never be quite sure exactly what it's referring to!

Any thoughts, anyone?

kaled

10:30 am on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are two set of characters that should be encoded in html.
1) characters used by html markup, e.g. <>"
2) characters with an ascii value greater than 127, however, I think this depends on the chosen character set - I've always had a mental block in this area. For English, this will typically be things like bullet characters.

In addition ampersand has to be encoded since it is used to signal that the following character sequence is a coded single entity.

However, your question was specifically about urls (which don't usually contain extended characters). In this case, encoding is used to ensure that the html is not ambiguous (rather than to ensure characters are displayed correctly). Provided all urls are wrapped in quotes, equals need not be encoded since there is no ambiguity.

Kaled.

HelenDev

4:13 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Excellent, thanks Kaled :)

With any luck most of the ambiguous SiteMorse errors will sort themselves out once I sort out the page validation.