C++ CGI Script replace space with %20
Posted on 2004-09-26
I'm looking for a way to replace a space with %20 in a link (string) that my script will output. This is one of my first attempts at using C++ for CGI so it's probably a relatively simple problem. I have looked at URL encoding functions and I really am not going to have anything else that needs to be url encoded other than a space character so I thought simply replacing the space with %20 would be faster than implementing a complete url encoding function. Speed is an issue here since the script will be getting well over two million views a day. Also, the space can not be replaced by a + since the site that I am linking to can't seem to parse the query string with a + in it.