Home
Highly Reusable Software By activity User Interface Text Strings Math Processing
Stored Data
Communications
Hard World File System
|
#License - #Source code - #Example Use -
#include <librock/html.h> char * librock_HTTP_astrSetFieldUrlEncode( char **ppaszQueryString, const char *pszName, const char *pszValue );
Returns *ppasz.
To determine if URL-encoding or Value-Encoding is more appropriate consider what will be decoding the string first.
There is no way to ValueEncode a '&' in an anchor HREF hyperlink. (See the note in RFC1866 8.2.1. Any '&' will be taken as a field separator.) Using & works usually.
Typical use is to modify an existing query string, or build one up from scratch. If field names are duplicated, use librock_HTTP_astrcatUrlEncode. This function will only modify the first matching field name.
#ifdef librock_TYPICAL_USE_HTTP_astrSetFieldUrlEncode char *asz = 0; librock_astrcpy(&asz,"file=some+value&file=not+replaced+value"); librock_HTTP_astrSetFieldUrlEncode(&asz,"file","index.html"); printf("%s\n",asz); librock_astrfree(&asz); #endif
strlen() strncmp() strchr() librock_HTTP_astrcatUrlEncode() librock_astrcat() librock_astrn0cpy() librock_astrfree() librock_counttoch()
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com Licensed under BSD-ish license, NO WARRANTY. Copies must retain this block. License text in <librock/license/librock.txt> librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45
librock_HTTP_astrSetFieldUrlEncode passed tests in thtml (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_HTTP_astrSetFieldUrlEncode passed tests in thtml (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.