title: How do I stop System.Uri from unencoding a URL?
body: <p>How do I stop the System.Uri class from unencoding an encoded URL passed into its constructor? Consider the following code:-</p>
  
  <pre><code>Uri uri = new Uri("http://foo.bar/foo%2FBar");
  Console.WriteLine(uri.AbsoluteUri);
  uri = new Uri("http://foo.bar/foo%2FBar", false);
  Console.WriteLine(uri.AbsoluteUri);
  uri = new Uri("http://foo.bar/foo%2FBar", true);
  Console.WriteLine(uri.AbsoluteUri);
  </code></pre>
  
  <p>In each case the output is "http://foo.bar/foo/bar". How can I ensure that after instantiating a Uri instance, Uri.AbsoluteUri will return "http://foo.bar/foo%2FBar"?</p>