Forum Moderators: open
I'm asked to replace & with & but this causes some problems on the server side where & isn't always interpreted as &. Has anyone else seen this? Any ideas what to do?
Also, I have noticed that URL encoding seems to break referrer on certain browsers such as Safari beta and also Mozilla 0.7 on KDE RedHat linux. Could this be a function of bugs in these beta versions or what?
Thanks
This is the same as escaping quotes within a quote delimited string in programming languages. When you want to have a string like
'Aaron's party' you need to escape the single quote in the middle. Otherwise it will be interpreted to mark the end of the string. The party' will then most likely cause a syntax error. Useragent have been more forgiving. They did not see this as a syntactical error when the use of the ampersand looked like a literal use. Programming languages could do the same. They might look further down the line for quotes. When they find another one they might automatically quote the middle one. However, such forgiving parsing rules make for a lot of ambiguities that are better avoided.
When you write a link like
http://www.ac.com/index.html?name=aaron&age=15 in an XML/SGML document the user agent will see that entity reference and know that you want it to render and interpret it as a literal ampersand. When the client requests that URI it will use http://www.ac.com/index.html?name=aaron&age=15. So all your server will ever see is the literal ampersand. Everything else would be a different URI which you might handle whatever way you want. Andreas