title: Uri.EscapeDataString() is converting / to %2F
body: <p>I am trying to convert strings to URI format, in order to use them in URLs that show some images in my page. I am using ASP.NET Core.</p>
  <p>for this I have used System.Web.HttpUtility.UrlEncode() I also tried Uri.EscapeDataString() .</p>
  <p>Both methods return practically the same thing (I would not discuss the difference between them in this thread) , but my problem is that the methods are also converting the character &quot;/&quot; to &quot;%2f&quot; .</p>
  <p>Here is a piece of code that I am using for that conversion :</p>
  <pre><code>        public string StringConvert()
      {
          string decoded= &quot;Example/of/string&quot;  ;
          string toShow = System.Web.HttpUtility.UrlEncode(encoded);   /*Uri.EscapeDataString(encoded); can also be used*/
          return toShow;
      }
  </code></pre>
  <p>I am calling the StringConvert method directly from the HTML view, and use it directly for the src of an img .
  the image cannot be accessed because of the &quot;%2f&quot; in the address.
  Might there be a way/workaround to bypass that ?</p>