URL Encode and Decode in ASP.NET Core

后端 未结 5 1895
花落未央
花落未央 2020-12-05 03:54
HttpContext.Current.Server.UrlEncode

It\'s only work in .NET Framework. How can I encode or decode uri arguments in ASP.NET Core project?

5条回答
  •  独厮守ぢ
    2020-12-05 04:25

    Don't waste your time, I've got plenty of experience with these so called url encoders, they are all useless, and have different quirks. Eg WebUtility.UrlEncode doesn't take care of "+" sign.

    If you want to encode URL parameters, employ a BASE58 encoding. It uses only alphabet letters + numbers, thus you don't need to url encode.

提交回复
热议问题