NAME

PSP::CGI::Transform - provides text string transformations commonly used by CGI programs.


SYNOPSIS

  use PSP::CGI::Transform;
  my $encoded = encodeHttp($text);
  my $text = decodeHttp($encoded);
  my $htmled = htmlize($text);
  my $htmled = htmlizeIsoUmlauts($isoText);


DESCRIPTION

This module exports some text string transformation procedures usually needed by CGI programs. This module was created as a companion to the Perl Script Pages Engine. See the PSP::Engine manpage for more information.


OVERVIEW

Exported Functions

encodeHttp
Encodes a generic text string into a HTTP URI encoded string. See encodeHttp function for details.

decodeHttp
Decodes a HTTP URI encoded string into a common text string. See decodeHttp function for details.

htmlize
Transforms any text into a safe HTML/XHTML representation that needs no further sanitizing, escaping or quoting for output on HTML/XHTML pages. See htmlize function for details.

htmlizeIsoUmlauts
Transforms ISO8859-{1,15} encoded German umlauts in the given text string into the HTML/XHTML equivalents. See htmlizeIsoUmlauts function for details.


SYNTAX

encodeHttp Function

Encodes a generic text string into a HTTP URI encoded string.

  use PSP::CGI::Transform;
  
  my $encoded = encodeHttp($text);

This function is exported automatically.

Required Parameters

$text
The text string to encode.

Optional Parameters

None.

Return Values

$encoded
The HTTP URI encoded representation of the input string or undef if $text was not defined.

decodeHttp Function

Decodes a HTTP URI encoded string into a common text string.

  use PSP::CGI::Transform;
  
  my $text = decodeHttp($encoded);

This function is exported automatically.

Required Parameters

$encoded
The HTTP URI text string to decode.

Optional Parameters

None.

Return Values

$text
The common text representation of the encoded input string or undef if $encoded was not defined.

htmlize Function

Transforms any text into a safe HTML/XHTML representation that needs no further sanitizing, escaping or quoting for output on HTML/XHTML pages.

  use PSP::CGI::Transform;
  
  my $htmled = htmlize($text);

This function is exported automatically.

Required Parameters

$text
Any text string to transform.

Optional Parameters

None.

Return Values

$htmled
The HTML/XHTML safe representation of the input string or undef if $text was not defined.

htmlizeIsoUmlauts Function

Transforms ISO8859-{1,15} encoded German umlauts in the given text string into the HTML/XHTML equivalents.

  use PSP::CGI::Transform;
  
  my $htmled = htmlizeIsoUmlauts($isoText);

This function does NOT pass the text through the htmlize function! You need to do that manually.

This function is exported automatically.

Required Parameters

$text
Any text string to transform.

Optional Parameters

None.

Return Values

$htmled
The same text as the input, but all ISO8859-{1,15} German umlauts replaced by the HTML/XHTML equivalence strings or undef if $text was not defined.


AUTHOR

Veit Wahlich

E-Mail: cru |at| zodia |dot| de

WWW: http://home.ircnet.de/cru/


VERSION

v0.7 Wednesday, 18 January 2006


COPYRIGHT/LICENSE

Copyright 2004-2006 Veit Wahlich

This software is distributed as free (libre) software under the terms of the GNU General Public License, version 2 <http://www.gnu.org/copyleft/gpl.html>. The author disclaims responsibility of any damage or harm caused directly or indirectly by usage of this software. Use only at your own risk.