MAN page from Old RedHat 6.X perl-HTML-Parser-3.05-6.i386.rpm
lib::HTML::Entities
Section: User Contributed Perl Documentation (3)
Updated: perl 5.005, patch 03
Index NAME
HTML::Entities - Encode or decode strings with HTML entities
SYNOPSIS
use HTML::Entities;
$a = "Våre norske tegn bør æres"; decode_entities($a); encode_entities($a, "\200-\377");
DESCRIPTION
This module deals with encoding and decoding of strings with HTMLcharacter entites. The module provides the following functions:
- decode_entities($string)
- This routine replaces HTML entities found in the $string with thecorresponding ISO-8859/1 character. Unrecognized entities are leftalone.
- endode_entities($string, [$unsafe_chars])
- This routine replaces unsafe characters in $string with their entityrepresentation. A second argument can be given to specify whichcharacters to concider as unsafe. The default set of characters toexpand are control chars, high-bit chars and the `<', `&', `>' and `"'characters.
Both routines modify the string passed as the first argument ifcalled in a void context. In scalar and array contexts the encoded ordecoded string is returned (and the argument string is leftunchanged).
If you prefer not to import these routines into your namespace you cancall them as:
use HTML::Entities (); $encoded = HTML::Entities::encode($a); $decoded = HTML::Entities::decode($a);
The module can also export the
%char2entity and the
%entity2charhashes which contain the mapping from all characters to thecorresponding entities.
COPYRIGHT
Copyright 1995-1998 Gisle Aas. All rights reserved.
This library is free software; you can redistribute it and/ormodify it under the same terms as Perl itself.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- COPYRIGHT
This document was created byman2html,using the manual pages.