PDA

View Full Version : Semicolon Seperator in Query String?


Pennimus
09-10-2007, 12:13 PM
Today I came across a site using semicolons instead of ampersands to seperate query/value pairs in URLs (for those interested, the site is interflora flowers (http://www.interflora.co.uk)).

This came as somewhat of a surprise as I hadn't realised this was even an option. Are they literally indentical in functionality or is there some reason than almost everyone uses ampersands instead of semicolons?

Personally I find semicolons to be neater and more readable but don't want to start using them if there is some drawback I don't know about.

nikkiH
09-10-2007, 06:47 PM
Most languages would use the ampersand to separate the values, as that is the standard. Either they have a custom parser and/or are using an unusual language that has an issue with html entities and ampersands.

I would not use semi-colons. Not only does every major language use them be default (asp, jsp, etc) but I would be risking developers after me getting quite confuzzled over it. Not to mention anyone using standard encode methods might get peeved.

Specs state ampersand.
http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2