Bug cgi encode

Use CGI instead of URI for parameter escaping