Just discovered something: the vital difference between
Now, up until recently, I'd always used
escape() to finagle text into a form suitable for returning via GET requests. However, I was trying to return some Unicode and Apache kept throwing "406 Not Acceptable"s at me.
Turns out the W3C-kosher way to do it is by encoding each Unicode character as three normal "%##" escapes within the normal ASCII URI escaping scheme. Fortunately, there exists
encodeURI(), which does nearly the same thing as
escape(), except it follows the W3C recommendations on encoding Unicode in URIs.
So remember, if there's even the merest smear of a chance of Unicode characters getting into your GET string, use
encodeURI() and you'll save yourself many a headache.
And that, ladies and gentlemen, is a Good Thing.