Safari does not URL-encode arguments of the document() function

David Peterson has found an interesting Safari bug: it looks like most other XSLT-capable browsers automatically URL-encode the invalid strings passed to the document() function, whereas Safari uses the input argument as-is (and fails if it contains unexpected characters).

Still, don't forget that URL encoding is the programmer's job and that the browsers only fix your errors when they do the encoding behind the scenes. However, properly encoding a URL string with the limited set of string-handling functions of XSLT 1.0 is close to Mission Impossible ... although of course it's been proven that it can be done even with a Turing machine ;)

And, last but not least, if you need a more detailed description of URL encoding - here it is.

No comments:

Post a Comment