Marius
Marius

Reputation: 58931

HttpContext.Current.Request.QueryString incorrectly decodes §

I have a query string which contains the character §, for example /search?q=5§2. This should be encoded as /search?q=5%c2%a72, but HttpContext.Current.Request.QueryString.ToString() gives me q=5%u00a72. For some reason the %c2 is lost.

Upvotes: 2

Views: 1104

Answers (1)

Lanorkin
Lanorkin

Reputation: 7504

Encoding is ok, you can read more details here http://en.wikipedia.org/wiki/Percent-encoding ("Non-standard implementations" part)

To not think about it you can just use HttpUtility.UrlDecode() to obtain real q=5§2 string regardless used encoding.

Upvotes: 1

Related Questions