title: How to get Uri.EscapeDataString to comply with RFC 3986
body: <p>The Uri class defaults to RFC 2396.  For OpenID and OAuth, I need Uri escaping consistent with RFC 3986.  </p>
  
  <p>From the <a href="http://msdn.microsoft.com/en-us/library/system.uri.aspx" rel="noreferrer">System.Uri class documentation</a>:</p>
  
  <blockquote>
    <p>By default, any reserved characters in the URI are escaped in accordance with RFC 2396. This behavior changes if International Resource Identifiers or International Domain Name parsing is enabled in which case reserved characters in the URI are escaped in accordance with RFC 3986 and RFC 3987.</p>
  </blockquote>
  
  <p>The documentation also states that activating this IRI mode and thus the RFC 3986 behavior means adding a uri section element to machine.config and this to your app/web.config file:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;uri&gt;
    &lt;idn enabled="All" /&gt;
    &lt;iriParsing enabled="true" /&gt;
    &lt;/uri&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But whether this is present in the .config file or not, I'm getting the same (non-3986) escaping behavior for a .NET 3.5 SP1 app.  <strong>What else do I need to do to get <code>Uri.EscapeDataString</code> to use the RFC 3986 rules?</strong> (specifically, to escape the reserved characters as defined in that RFC)</p>