RPGspHTMLEncode Function


Encodes a string so that it can be displayed in a browser as text, instead of being interpreted as HTML code.


Syntax

RPGspHTMLEncode(character string)

Part Description
character string Required. Any string that may have special characters used for HTML coding.


Remarks

HTML encoding ensures that text is correctly displayed in the browser, not interpreted by the browser as HTML. For example, if a text string contains "<" or ">" characters, the browser would interpret these characters as part of HTML tags. The HTML encoding of these two characters is "&lt;" and "&gt;", respectively, which causes the browser to display the angle brackets correctly.


Example

Here is a snippet of RPG that uses RPGspHTMLEncode to encode user input:

     C*   Retrieve text from a text area
     C                   Eval      Text = RPGspIn('TEXTAREA1')	 
	 
     C*   To be safe, encode it before redisplaying in the browser
     C                   Eval      Text = RPGspHTMLEncode(Text)	 	 


See Also

RPGspURLEncode

RPGspIn

%Char


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925