1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
/*
Copyright (C) 2008- The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef URL_ENCODE_H
#define URL_ENCODE_H
/** @file url_encode.h provides routines for encoding strings according to RFC-2396.
This is typically used to constructing strings that don't have spaces or other
special characters, and can be safely used as file names, URLs, or other identifiers
where special characters are not allowed.
*/
/** Encodes a plain ASCII string into the percent-hex form of RFC 2396.
For example, the string <tt>Let's go</tt> becomes <tt>Let%27s%20go.</tt>
Typically used to encode URLs and Chirp file names.
@param source The plain ASCII input string.
@param target The location of the encoded output string.
@param length The size in bytes of the output string space.
@see url_decode
*/
void url_encode(const char *source, char *target, int length);
/** Decodes an RFC 2396 string into plain ASCII.
For example, the string <tt>Let%27s%20go</tt> becomes <tt>Let's go</tt>.
Typically used to decode URLs and Chirp file names.
@param source The location of the encoded output string.
@param target The plain ASCII input string.
@param length The size in bytes of the output string space.
@see url_encode
*/
void url_decode(const char *source, char *target, int length);
#endif
|