views:

40

answers:

1

Hi,

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 that 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.

A: 

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

Zhaph - Ben Duguid
Im using Asp.Net and HttpUtility.UrlPathEncode does't do + as space it do %20, and I don't want to take care of every single char conversion myself if I dont have to.