balupton/history.js — Issue #136: URLs with Japanese query strings are handled incorrectly
Author: naofumi
Created: 2011-12-02 05:26:11+00:00
State: open

Thanks for this awesome library!

My issue is when I send a url with Japanese query strings into #pushState, the strings get corrupted.

```javascript
History.pushState(null, null, '/?query=%E6%8A%97%E4%BD%93');
alert(History.getState().url);
```
Then I get;
"/?query=æ%C2%8A%C2%97ä½%C2%93"
when I should be getting;
"/?query=抗体"

The problem is in
https://github.com/balupton/history.js/commit/c2c15fa0527100b10cc0798f772871e68f3405e1

In History.unescapeString(), line number 946, you are using window.unescape() to unescape the URL.

As far as I know, you should be using decodeURI() instead of unescape().

As discussed in the following article, unescape() will have problems with non-ASCII characters, and that is what is happening in this case.

http://stackoverflow.com/questions/619323/decodeuricomponent-vs-unescape-what-is-wrong-with-unescape