Annotation of libwww/Library/src/HTEscape.html, revision 2.13
2.2 frystyk 1: <HTML>
2: <HEAD>
2.12 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
4: <NEXTID N="1">
2.13 ! frystyk 5: <TITLE>W3C Sample Code Library libwww URIs</TITLE>
2.2 frystyk 6: </HEAD>
2.1 frystyk 7: <BODY>
2.12 frystyk 8: <H1>
9: Escape and Unescape Illegal Characters in URIs
10: </H1>
2.2 frystyk 11: <PRE>
12: /*
2.5 frystyk 13: ** (c) COPYRIGHT MIT 1995.
2.2 frystyk 14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
2.12 frystyk 17: <P>
18: URLs are written only with the graphic printable characters of the US-ASCII
19: coded character set. All other characters must be escaped before they can
20: be used in URLs. This module defines the methods required for escaping and
21: unescaping the URLs. Internally in the Library, all URLs are escaped so that
22: we never see illegal characters in the URL handled by the Library. We only
23: unescape the URLs when we have to, for example while taking to the local
24: file system etc.
25: <P>
26: This module is implemented by <A HREF="HTEscape.c">HTEscape.c</A>, and it
2.13 ! frystyk 27: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Sample Code
2.12 frystyk 28: Library</A>.
2.1 frystyk 29: <PRE>
30: #ifndef HTESCAPE_H
31: #define HTESCAPE_H
2.3 frystyk 32:
2.1 frystyk 33: </PRE>
2.12 frystyk 34: <H2>
35: Encode Unacceptable Characters using %xy
36: </H2>
37: <P>
38: This function takes a string containing any sequence of ASCII characters,
39: and returns a malloced string containing the same infromation but with all
40: "unacceptable" characters represented in the form <CODE>%xy</CODE> where
41: <CODE>x</CODE> and <CODE>y</CODE> are two hex digits.
2.1 frystyk 42: <PRE>
2.8 frystyk 43: typedef enum _HTURIEncoding {
44: URL_XALPHAS = 0x1,
45: URL_XPALPHAS = 0x2,
46: URL_PATH = 0x4
47: } HTURIEncoding;
2.1 frystyk 48:
2.9 frystyk 49: extern char * HTEscape (const char * str, HTURIEncoding mask);
2.1 frystyk 50: </PRE>
2.12 frystyk 51: <H2>
52: Decode %xy Escaped Characters
53: </H2>
54: <P>
55: This function takes a pointer to a string in which character smay have been
56: encoded in <CODE>%xy</CODE> form, where <CODE>xy</CODE> is the acsii hex
57: code for character 16x+y. The string is converted in place, as it will never
58: grow.
2.1 frystyk 59: <PRE>
2.8 frystyk 60: extern char * HTUnEscape (char * str);
61: </PRE>
62: <PRE>
2.1 frystyk 63: #endif /* HTESCAPE_H */
64: </PRE>
2.12 frystyk 65: <P>
66: <HR>
2.11 frystyk 67: <ADDRESS>
2.13 ! frystyk 68: @(#) $Id: HTEscape.html,v 2.12 1996/06/01 17:46:46 frystyk Exp $
2.11 frystyk 69: </ADDRESS>
2.12 frystyk 70: </BODY></HTML>
Webmaster