C++ implementation of URL encoding (http://tools.ietf.org/html/rfc3986)