[progress Communities] [progress Openedge Abl] Forum Post: Re: Map Ascii Characters To...

  • Thread starter Thread starter tbergman
  • Start date Start date
Status
Not open for further replies.
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, "&amp~;":U) /* ampersand */ p_in = REPLACE(p_in, "~"":U, "&quot~;":U) /* quote */ p_in = REPLACE(p_in, " ":U, "&gt~;":U). /* > */ RETURN p_in. END FUNCTION. /* html-encode */

Continue reading...
 
Status
Not open for further replies.
Back
Top