I want something to turn ?a=5&b=8 part of a URL into a dictionary { a:5, b:8 }.
Is there such method in .net or am I on my own?
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.
Example:
Firefox encodes as following:
- v v
http://localhost:8041/Reforge.aspx?name=ArcânisГ
Firefox turns into
http://localhost:8041/Reforge.aspx?name=Arc%C3%A2nis%D0%93`
Notice that UTF8 encoding is used for both non-ASCII characters.
- v
http://localhost:8041/Reforge.aspx?name=Arcâ
Firefox turns into
http://localhost:8041/Reforge.aspx?name=Arc%E2
Notice that ISO-8859-1 (Latin-1) encoding is used for the non-ASCII character.
Here is a related question: ASP.NET MVC does not understand mixed url encoding (UTF-8/Latin-1)