encode-web
Purpose:
Web(HTML)-encode string.
Syntax:
encode-web <string> to [ define ] <encoded string> \
[ output-length [ define ] <encoded length> ] \
[ input-length <length> ]
Description:
encode-web encodes <string> so it can be used in a HTML-like markup text (such as a web page or an XML/XHTML document), and stores the result in <encoded string> which may be created with optional
"define". <encoded string> is
allocated memory.
Optional
"output-length" clause lets you get the length of the encoded string in <encoded length>, which can be created with optional
"define". You can encode only the first <length> bytes, given by an
"input-length" clause.
Examples:
In this example, a string
"str" will be web-encoded and the result is in
"result" variable, with its length in
"len_of_result" variable:
char str[]=" x<y>z&\"' ";
encode-web str to define result output-length define len_of_result
The
"result" is
" x<y>z&"' " and
"len_of_result" is 33.
See also: