I wrote a small test page to grab document.referrer
of users with javascript and send it to a simple log server (like sendReferrer(document.referrer)
).
The referrer Firefox sends is always url-encoded, (eg. 'http://www.google.com/search?q=%C3%9C' when referrer url is www.google.com/search?q=Ü)
But some clients (like IE9 on Win7) sends urls without url-encoding (www.google.com/search?q=Ü)
Is document.referrer
is url-encoded in all browsers? Is this reliable (part of any standard) or not?
UPDATE: In Firefox15/Chrome21 (on ubuntu) document.referrer is url-encoded
My final answer for this question: Referer
may/may not be encoded! With my tests some (only some!) IEs send unencoded referrers (I guess it depends on the locale of client system)