Replacement for System.Web.HttpUtility.UrlEncode / UrlDecode ASP.NET 5

I would like to know if there is a replacement for System.Web.HttpUtility.UrlEncode and UrlDecode .

As I found for Encode , it should be: Microsoft.Framework.WebEncoders.UrlEncoder.Default.UrlEncode .

But I did not find UrlDecode . There is one?

+50
c # asp.net-mvc asp.net-core asp.net-core-mvc
Sep 07 '15 at 8:40
source share
1 answer

System.Runtime.Extensions defines both UrlDecode and HtmlDecode .

 namespace System.Net { public static partial class WebUtility { public static string HtmlDecode(string value) { return default(string); } public static string HtmlEncode(string value) { return default(string); } public static string UrlDecode(string encodedValue) { return default(string); } public static byte[] UrlDecodeToBytes(byte[] encodedValue, int offset, int count) { return default(byte[]); } public static string UrlEncode(string value) { return default(string); } public static byte[] UrlEncodeToBytes(byte[] value, int offset, int count) { return default(byte[]); } } } 

Update
While System.Runtime.Extensions defines the extension, since you can notice the code from it, the actual class you need to call is System.Net.WebUtility

 System.Net.WebUtility.HtmlEncode(myString) System.Net.WebUtility.HtmlDecode(myString) 

There are currently no publicly planned plans for incorporating Decode into Microsoft.Framework.WebEncoders .

+98
Sep 07 '15 at 9:07
source



All Articles