Nic wrote:
Hello all,
I ran into a problem encoding/decoding special characters in URLs.
by using Server.UrlEncode and Server.UrlDecode.
Basically, encoding x+y results in x%2by, however decoding
x%2by results in x y (missing the +).
This does not happen to me:
Console.WriteLine( HttpUtility.UrlDecode( "x%2by"));
I'm guessing that what's happening is that you're passing in to
UrlDecode a string that you've gotten from Request.QueryString[] (or
something similar).
The strings in the QueryString collection have already been decoded, so
you would be in effect decoding the string twice which would result in
the behavior you're seeing ('+' gets decoded into a space).
--
mikeb