history.js icon indicating copy to clipboard operation
history.js copied to clipboard

Pushing state with urlEncode don´t work correct

Open otavioserra opened this issue 13 years ago • 3 comments

I have one script in php using urlencode() [http://bit.ly/L1BYf4] with ajax for this example:

http://localhost/maclik/procurar/será

Resulting this:

http://localhost/maclik/procurar/ser%E1

But when I execute History.pushState() and push this url resulting this in adress bar for Chrome, Firefox, Opera:

http://localhost/maclik/procurar/ser%C3%A1

Value for this chars in Url Enconding Reference [http://bit.ly/L1BZPW] :

%E1 - á %C3 - Ã %A1 - ¡

But, when I try:

var State = History.getState();

alert(State.url);

Resulting this:

http://localhost/maclik/procurar/será

I don´t know whats going and I supose this is one bug in history.js encodeUrl.

Thanks for now

otavioserra avatar May 29 '12 18:05 otavioserra

Hi,

I have the same issue, anybody has a solution for this one ?

"/search/a%2Fb%20testing" converted into => "/search/a/b%20testing"

bcambel avatar Jun 07 '12 18:06 bcambel

I think I also have some kind of similar issue: ✓ = â It works in Firefox but fails in Chrome.

lephyrius avatar Jul 10 '12 15:07 lephyrius

maybe someone will come in handy ... it worked correctly like this:

window.History.pushState( null, null, decodeURI(YOUR_URL_HERE));

wrap url in decodeURI(); function

bbik52 avatar Dec 06 '18 16:12 bbik52