Search code examples
javascriptgoogle-chromemozillaurl-encoding

URL encoding difference between Mozilla and Chrome


I have the following url enter image description here

It contains a parameter ?key=vE$%fds9 which I am reading into my JavaScript program.

Per url encoding cross reference at https://www.w3schools.com/tags/ref_urlencode.asp the %fd translates to a ý character.

It is behaving differently between Mozilla and Chrome browsers.

Chrome returns a ý result as expected enter image description here Mozilla returns a enter image description here Anybody know how I can modify the JavaScript so that Mozilla translates it properly?

As always, thanks to the experts out there!


Solution

  • you should use the utf-8 encoding for this character which is %C3%BD

    so this should be ?key=vE$%C3%BDs9 to be compatible in all browser versions