title: What's the difference between Request.Url.Query and Request.QueryString?
body: <p>I have been tracking down a bug on a Url Rewriting application.  The bug showed up as an encoding problem on some diacritic characters in the querystring.</p>
  
  <p>Basically, the problem was that a request which was basically /search.aspx?search=heřmánek was getting rewritten with a querystring of "search=he%c5%99m%c3%a1nek"</p>
  
  <p>The correct value (using some different, working code) was a rewrite of the querystring as "search=he%u0159m%u00e1nek"</p>
  
  <p>Note the difference between the two strings.  However, if you post both you'll see that the Url Encoding reproduces the same string.  It's not until you use the context.Rewrite function that the encoding breaks.  The broken string returns 'heÅmÃ¡nek' (using Request.QueryString["Search"] and the working string returns 'heřmánek'.  This change happens after the call to the rewrite function.</p>
  
  <p>I traced this down to one set of code using Request.QueryString (working) and the other using Request.Url.Query (request.Url returns a Uri instance).</p>
  
  <p>While I have worked out the bug there is a hole in my understanding here, so if anyone knows the difference, I'm ready for the lesson.</p>