Fix the encoding of the query string

This should get things working for all .Net versions