This function converts various characters that can be misinterpreted as HTML formatting to their HTML entity representation. The characters <, >, & and " (double quote) are converted to <, >, &, and " respectively.
Location
web\method\cgiutils.i
Parameters
INPUT p_in AS CHARACTER
The character string to encode.
Returns
CHARACTER
Notes
This function cannot be called more than once on a string. This is because ampersands are replaced with & and recursive calls will fail.
Examples
PROCEDURE displayFields:
\*-------------------------------------------------------------------------
Purpose: Override standard ADM method
-------------------------------------------------------------------------*\
RUN SUPER.
\* The comment field may contain <, >, quotes and ampersands. To be safe, convert these characters. *\
IF AVAILABLE Customer THEN
Customer.Comments:SCREEN-VALUE IN FRAME {&FRAME-NAME} =
html-encode(Customer.Comments).
END PROCEDURE.