title: ASP.NET MVC parse URL query part
body: <p>I want something to turn <code>?a=5&amp;b=8</code> part of a URL into a dictionary { a:5, b:8 }.</p>
  
  <p>Is there such method in .net or am I on my own?</p>
  
  <p>I need to parse query part so that I can implement my own URL decoding.
  The problem is that Firefox uses different encoding (UTF8 or ISO-8859-1) depending on the used alphabet.</p>
  
  <p>Example:</p>
  
  <p>Firefox encodes as following:   </p>
  
  <pre><code>-                                          v   v
  http://localhost:8041/Reforge.aspx?name=ArcânisГ 
  Firefox turns into  
  http://localhost:8041/Reforge.aspx?name=Arc%C3%A2nis%D0%93`  
  </code></pre>
  
  <p>Notice that <code>UTF8</code> encoding is used for both non-ASCII characters.</p>
  
  <pre><code>-                                          v
  http://localhost:8041/Reforge.aspx?name=Arcâ
  Firefox turns into
  http://localhost:8041/Reforge.aspx?name=Arc%E2
  </code></pre>
  
  <p>Notice that <code>ISO-8859-1</code> (Latin-1) encoding is used for the non-ASCII character.</p>
  
  <p>Here is a related question: <a href="https://stackoverflow.com/questions/4168636/asp-net-mvc-does-not-understand-mixed-url-encoding-utf-8-latin-1">ASP.NET MVC does not understand mixed url encoding (UTF-8/Latin-1)</a></p>