I'm facing a problem where Internet Explorer (10, but I think I have the same issue with older IEs) will encode a URL differently based on if I click a link normally or if I open it in a new tab by Control-clicking on it.
I have made small JSBin to test the issue, and this is what Wireshark shows when I click the link normally:
This is what I get when control-clicking:
Notice that the "Å" in the URL is encoded differently, "\305" in the first case, and "\303\205" in the second.
How to reproduce
You need Wireshark or some similar tool, so some work is required.
- Go to this JSBin: http://jsbin.com/agukeg/5 in Internet Explorer
- Start Wireshark (or your tool of choice) and start capturing.
- Click on the link "testme" (normally, not with Control).
- Click on the link while holding down Control
- Compare the URLs in Wireshark
Why is this happening, and more importantly, is there a workaround or a real fix?
That's an invalid URL. Browsers like Google Chrome might fool developers because their address bar show decoded characters, but they never send those characters to server but use standard URL encoding behind the scenes. Additionally, when you copypaste an URL from Google Chrome address bar, the ugly encoding makes it to your clipboard.
The only characters allowed in an URL without encoding are:
Encode the URL in your link: