only encode the query string if it isn't already encoded