MAN page from RedHat Other perl-HTML-Parser-2.20-1.i386.rpm
lib::HTML::Entities
Section: User Contributed Perl Documentation (3)
Updated: perl 5.004, patch 04
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 provide 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 `"'character.
Both routines modify the string passed in as the first argument ifcalled in void context. In scalar and array context 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 contains 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.