开发者

Why does Internet explorer encode link urls on the fly, and how to stop that behavior?

开发者 https://www.devze.com 2022-12-15 16:38 出处:网络
I have a really annoying problem with IE (all versions from what I can tell). Every link produced from the server side (may it be a string with an a-tag, hyperlink etc.) gets encoded on IE.

I have a really annoying problem with IE (all versions from what I can tell). Every link produced from the server side (may it be a string with an a-tag, hyperlink etc.) gets encoded on IE. Eg. http://www.some-domain.com/my document.pdf gets a correct encoding to: http://www.some-domain.com/my%20document.pdf However if I decide to do 开发者_如何学Gothat encoding myself on the server side we get: http://www.some-domain.com/my%20document.pdf and IE encodes this (and that is the problem) and we get: http://www.some-domain.com/my%2520document.pdf and the result is a link that is not correct.

%25 = % => %2520 = %20

How can I stop this behaviour in IE? Every other browser i've tried does not do this.


You could try replacing the space with a + - browsers treat this as a space and it shouldn't need encoding.

http://www.example.com/my+document.pdf

0

精彩评论

暂无评论...
验证码 换一张
取 消