Replace URI.escape with CGI.encode_www_form_component