#821: Referrer check breaks with UTF-8 URLs

Everything should be OK now.