Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
KHTTP_URLENCODE(3)     FreeBSD Library Functions Manual	    KHTTP_URLENCODE(3)

NAME
     khttp_urlencode --	URL encoding for kcgi

LIBRARY
     library "libkcgi"

SYNOPSIS
     #include <sys/types.h>
     #include <stdarg.h>
     #include <stdint.h>
     #include <kcgi.h>

     char *
     khttp_urlencode(const char	*cp);

DESCRIPTION
     Percent-encodes a string cp, usually for embedding	in a URL, and returns
     the allocated result.  If passed a	NULL, returns an allocated empty
     string.

     The encoding uses capital-letter hex encoding.

RETURN VALUES
     Returns a newly-allocated string that must	be freed with free(3) or NULL
     if	allocation fails.

     The deprecated form of this function, kutil_urlencode(), should no	longer
     be	used.

EXAMPLES
     The following table shows strings pre- and	post-encoding.

     foo bar   foo+bar
     foo+bar   foo%2Bbar

AUTHORS
     Written by	Kristaps Dzonsons <kristaps@bsd.lv>.

FreeBSD	13.0			 July 11, 2020			  FreeBSD 13.0

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | EXAMPLES | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=khttp_urlencode&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help