[Top] [Prev] [Next] [Bottom] [Contents]

SaMakeHtmlString

Makes an HTML-compatible string from its argument.

Synopsis

#include "SaRnHtml.h"
char* SaMakeHtmlString(char* str);

Arguments

str
The string to convert.

Return Values

Returns an HTML-compatible string from its argument. Returns an empty string if the input is NULL.

Description

Returns an HTML-compatible string from its argument. Returns an empty string if the input is NULL. When you send back HTML from a server application, you must escape certain characters so that the browser does not interpret them as special HTML characters. The browser will then "unescape" the string and the original characters will appear to the user. The following translations are done:

< becomes "&lt;"
> becomes "&gt;"
& becomes "&amp;"
" becomes "&quot;"
The returned string is malloc'd data and must be free'd. Use this function when writing out data to return from a server application.

Example

char* htmlStr;
htmlStr = SaMakeHtmlString("<>");
/*** htmlStr contains: &lt;&gt; ****/
free(htmlStr);

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.