Start of change

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. 

Read syntax diagramSkip visual syntax diagramHTML_ENTITY_DECODE(string-expression )
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.
In addition, the named characters referenced by https://www.w3.org/TR/2011/WD-html5-20110525/named-character-references.html are decoded.

Example

  • Decode an HTML string containing HTML entities for the < > " '  and &  characters into the corresponding string
    VALUES HTML_ENTITY_DECODE('&lt;&gt;&quot;&apos;&amp;') 
    Returns
    <>"'&  
End of change