Search code examples
c#url-encoding

Hex Url decoder c#


i have a URL like http%3A%2F%2Fwww%2Ewikimoveis%2Ecom%2Ebr%2Ffotos%2F1292%2FKO2551%2FDSC01366%2EJPG

I need to get it decode correctly. I believe that is Hexadecimal. Can't find any C# code that would do that.

thank you


Solution

  • From C# URLDecode turns %5C into \\\\ instead of \

    using System;
    using System.Web;
    
    string url = "http%3A2F%2Fwww%2Ewikimoveis%2Ecom%2Ebr%2Ffotos%2F1292%2FKO2551%2FDSC01366%2EJPG"
    string decoded = HttpUtility.UrlDecode(url);