T
tbergman
Guest
While I use .Net now, here's an older version. I think this came from some of the Progress webspeed code but I'm not certain. FUNCTION htmlEncode RETURNS CHARACTER (INPUT p_in AS CHARACTER): /**************************************************************************** Description: Converts various ASCII characters to their HTML representation to prevent problems with invalid HTML. This procedure can only be called once on a string or ampersands will incorrectly be replaced with "& . Input Parameter: Character string to encode Returns: Encoded character string ****************************************************************************/ /* Ampersand must be replaced first or the output will be hosed if done after any of these other subsititutions. */ ASSIGN p_in = REPLACE(p_in, "&":U, "&~;":U) /* ampersand */ p_in = REPLACE(p_in, "~"":U, ""~;":U) /* quote */ p_in = REPLACE(p_in, " ":U, ">~;":U). /* > */ RETURN p_in. END FUNCTION. /* html-encode */
Continue reading...
Continue reading...