Re: URLEncode/Decode
From: mikeb (mailbox.google_at_nospam.mailnull.com)
Date: 08/19/04
- Next message: bruce barker: "Re: linked pages"
- Previous message: Scott M.: "Re: asp/javascript question"
- In reply to: Nic: "URLEncode/Decode"
- Next in thread: Nic: "Re: URLEncode/Decode"
- Reply: Nic: "Re: URLEncode/Decode"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Aug 2004 10:17:16 -0700
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
- Next message: bruce barker: "Re: linked pages"
- Previous message: Scott M.: "Re: asp/javascript question"
- In reply to: Nic: "URLEncode/Decode"
- Next in thread: Nic: "Re: URLEncode/Decode"
- Reply: Nic: "Re: URLEncode/Decode"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|