Chapter Contents

Previous

Next
HTMLDECODE

HTMLDECODE



Decodes a string containing HTML numeric character references or HTML character entity references and returns the decoded string

Category: Web Tools


Syntax
Arguments
Details
Examples
See Also

Syntax

HTMLDECODE(argument)

Arguments

argument
specifies any character expression.


Details

The HTMLDECODE function recognizes the following character entity references:

Character entity reference ... decodes as ...
& &
&lt; <
&gt; >
&quot; "
&nbsp; (space)

Numeric character references have one of the following forms:

&#nnn; where nnn specifies a decimal number that contains one or more digits.
&#Xnnn; where nnn specifies a hexadecimal number that contains one or more digits.

Operating Environment Information:   Numeric character references greater than zero and less than or equal to 255 are converted to the corresponding character in the character set supported by your operating environment. In all operating environments, references greater than 255 are converted to a question mark (?).   [cautionend]

Operating Environment Information:   In operating environments that use EBCDIC, SAS performs an extra translation step after it recognizes an HTML numeric character reference. The specified reference is assumed to be an ASCII encoding. SAS uses the transport-to-local translation table to convert this character to an EBCDIC character in operating environments that use EBCDIC. If the translation table does not specify a corresponding EBCDIC character, SAS inserts a question mark (?). For more information see TRANTAB=.  [cautionend]


Examples

SAS Statements Results
x1=htmldecode ('not a &lt;tag&gt;');
put x1;
  
not a <tag>
x2=htmldecode ('&amp;');
put x2;
  
&
x3=htmldecode ('&#65;&#66;&#67;');
put x3;
   
ABC


See Also

Function:

HTMLENCODE


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.