encodeWithURLEscapeSequences should URL-encode all needed chars. Currently it doesn't encode ?, #, +, & at least, all of which cause trouble. For example, try encoding the string "c++ vector". It becomes "c+++vector", which when sent to a page obviously becomes "c vector", not what the user intended.
I briefly looked into this in the past, and I think that the situation is substantially more complicated. Different parts of a URL need different escaping, so we need a more involved change than just adding more characters to this function.