title: Uncaught TypeError: undefined is not a function for window.location.pathname
body: <p>I keep getting <code>Uncaught TypeError: undefined is not a function</code> for the following code:</p>
  
  <pre><code>var jay = /^(\/gallery\/P[\w\dåäö\/]+)$/;
  if(window.location.pathname.test(jay)) {  // It complains about this line
      alert(2);
  }
  </code></pre>
  
  <p><code>console.log(window.location.pathname)</code> prints <code>/gallery/P1290574/%C3%A4ndra</code>. The file is encoded in UTF-8. In the address bar it says <code>/gallery/P1290574/ändra</code>. When I run the regex on <a href="http://regexpal.com/" rel="nofollow">regexpal.com</a> against <code>/gallery/P1290574/ändra</code>, it works like a charm but not on my website.</p>
  
  <p>What have I missed? Do I have to change the regex so it can identify <code>%C3%A4</code> too?</p>