HTML_ENTITY_DECODE
The HTML_ENTITY_DECODE scalar function returns a character string in which HTML entities have been decoded into their corresponding character values. The function can be used to convert HTML data containing HTML entities received from a web service into the corresponding character data.
- string-expression
- A string expression that returns a built-in character string. The string will be converted to a varying length character string in CCSID 1208 before decoding.
The result of the function is a varying length character string with a CCSID of 1208 in which HTML entities have been decoded.
The following entity values are decoded:
- &#nnnn; where nnnn is the code point in decimal form.
- &#xhhhh; where hhhh is the code point in hexadecimal form.
Example
- Decode an HTML string containing HTML entities for the < > " ' and & characters into
the corresponding string
ReturnsVALUES HTML_ENTITY_DECODE('<>"'&')
<>"'&