url decode


How can I decode url using vb.net or c# or asp.net, the example is as below:


Decoded by browser:
Other scenario are characters like %6C in url.

I need clean url so I can use with DownloadString of webClient to scrape data.

Thank you
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Well basic decoding is done via the HttpServerUtility.UrlDecode method


But that doesn't handle the URL conversion that wikipedia is doing....
mkk39Author Commented:
Thanks for reply

I already tried it but it is not working with example I have shown, please help me to solve issue with my example too

Thank you
Your example is not encoded therefore cannot be decoded.  It is being converted by wikipedia.
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

mkk39Author Commented:
So, how can I handle it to use with DownloadString ? or any other solution?
mkk39Author Commented:
Is there any other trick used by wiki, like here in example usage of colon. Can u please tell me if there are others too

Thank you
WebClient wc = new WebClient();
            wc.Headers.Add("User-Agent: Mozilla/4.0 (compatible; MSIE 8.0)");
            string s = wc.DownloadString("http://en.wikipedia.org/wiki/simple:car");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.