Skip to content

__aws_urlencode isn't cutting it #13

@GoogleCodeExporter

Description

@GoogleCodeExporter
__aws_urlencode isn't really cutting it. The current implementation seems to be 
barfing on tabs. Can I suggest switching to curl_easy_encode(...) ?

/**
 * Perhaps something like this would be more correct.
 */
static void __aws_urlencode ( char * src, char * dest, int nDest )
{
  CURL* curl =  curl_easy_init( );
  char *encoded = curl_easy_escape(curl, src, strlen(src));

  size_t length = (nDest - 1);

  __debug ( "Encoding: %s", src );

  if (strlen(encoded) < length) {
    length = strlen(encoded);
  }

  memcpy(dest, encoded, length + 1);
  __debug ( "Encoded To: %s", dest );

  curl_free(encoded);
  curl_easy_cleanup(curl);
}

Original issue reported on code.google.com by a...@sartre.in on 18 Aug 2013 at 8:45

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions