Annotation of libwww/Library/src/HTEscape.html, revision 2.2
2.2 ! frystyk 1: <HTML>
! 2: <HEAD>
2.1 frystyk 3: <TITLE>Escape and Unescape Illegal Characters in URIs</TITLE>
4: <NEXTID N="1">
2.2 ! frystyk 5: </HEAD>
2.1 frystyk 6: <BODY>
7:
8: <H1>Escape and Unescape Illegal Characters in URIs</H1>
2.2 ! frystyk 9:
! 10: <PRE>
! 11: /*
! 12: ** (c) COPYRIGHT CERN 1994.
! 13: ** Please first read the full copyright statement in the file COPYRIGH.
! 14: */
! 15: </PRE>
2.1 frystyk 16:
17: This module have been spawned from <A HREF="HTParse.html">HTParse</A>,
18: as it then can be used in utility programs without loading a whole
19: bunch of the library code. It contains functions for escaping and
20: unescaping a URI for reserved characters in URIs. <P>
21:
22: This module is implemented by <A HREF="HTEscape.c">HTEscape.c</A>, and
23: it is a part of the <A NAME="z10"
24: HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">Library
25: of Common Code</A>.
26:
27: <PRE>
28: #ifndef HTESCAPE_H
29: #define HTESCAPE_H
30: </PRE>
31:
32:
33: <H2>Encode Unacceptable Characters using %xy</H2>
34:
35: This funtion takes a string containing any sequence of ASCII
36: characters, and returns a malloced string containing the same
37: infromation but with all "unacceptable" characters represented in the
38: form <CODE>%xy</CODE> where <CODE>x</CODE> and <CODE>y</CODE> are two
39: hex digits.
40:
41: <PRE>
42: extern char * HTEscape PARAMS((CONST char * str, unsigned char mask));
43: </PRE>
44:
45: The following are valid mask values. The terms are the BNF names in
46: the URI document.
47:
48: <PRE>
49: #define URL_XALPHAS (unsigned char) 1
50: #define URL_XPALPHAS (unsigned char) 2
51: #define URL_PATH (unsigned char) 4
52: </PRE>
53:
54: <H2>Decode %xy Escaped Characters</H2>
55:
56: This function takes a pointer to a string in which character smay have
57: been encoded in <CODE>%xy</CODE> form, where <CODE>xy</CODE> is the
58: acsii hex code for character 16x+y. The string is converted in place,
59: as it will never grow.
60:
61: <PRE>
62: extern char * HTUnEscape PARAMS(( char * str));
63:
64:
65: #endif /* HTESCAPE_H */
66: </PRE>
67:
68: End of HTEscape Module
69: </BODY>
70: </HTML>
71:
Webmaster