Coding Domain

Perl Modules: HTML::EscapeASCII


Downloads
Perl Modules
Name
HTML::EscapeASCII - Converts special ASCII characters to HTML escape codes

Synopsis
use HTML::EscapeASCII;

my @Fields = ('RenE<egrave>', 'Bites & bytes', 'Say <hello>');

&FormatFieldHTML(@Fields);    # @Fields now is HTML text
# Values: Ren&egrave;, Bites &amp; bytes, Say &lt;hello&gt;

&FormatFieldText(@Fields);    # @Fields is restored as plain text.

Description
This module makes converts plain text ASCII codes into HTML escape codes. This will be very useful when showing the text input from a user, preventing any text evaluated as HTML codes.

Exported Functions
FormatFieldHTML(@Array)
Converts all the items in @Array from plain ASCII into HTML escape codes where useful.

FormatFieldText(@Array)
Reverses the changes done by FormatFieldHTML. All HTML escape codes are replaced by their real ASCII equivalents.

Author
Copyright (c) 2001, Diederik van der Boor - All Rights Reserved