NAME

PApp::Recode - convert bytes from one charset to another


SYNOPSIS

 use PApp::Recode;
 # not auto-imported into .papp-files
 $converter = to_utf8 PApp::Recode "iso-8859-1";
 $converter->("string");


DESCRIPTION

This module creates conversion functions that enable you to convert text data from one character set (and/or encoding) to another.

#FIXME# this module is certainly NOT finished yet, as PApp itself currently uses PApp::Recode::Pconv internaly ;->

FUNCTIONS

charset_valid $charset
Returns a boolean indicating wether the named charset is valid on this system (i.e. can be converted from/to UTF-8).

Currently this function always returns 1. #FIXME#

THE PApp::Recode CLASS

This class has never been tested, so don't expect it to work.

$converter = new PApp::Recode ``destination-charset'', ``source-charset'' [, \&fallback]
Returns a new conversion function (a code reference) that converts its argument from the source character set into the destination character set each time it is called (it does remember state, though. A call without arguments resets the state).

Perl's internal utf8-flag is ignored on input and not set on output.

$converter = to_utf8 PApp::Recode ``source-character-set'' [, \&fallback]
Similar to a call to new with the first argument equal to ``utf-8''. The returned conversion function will, however, forcefully set perl's utf-8 flag on the returned scalar.

$converter = utf8_to PApp::Recode ``destination-character-set'' [, \&fallback]
Similar to a call to new with the second argument equal to ``utf-8''. The returned conversion function will, however, upgrade its argument to utf-8.

THE PApp::Recode::Pool CLASS

NYI

THE PApp::Recode::Pconv CLASS

This is the class that actually implements character conversion. It should not be used directly.

new PApp::Recode::Pconv tocode, fromcode [, fallback]
PApp::Recode::Pconv::open tocode, fromcode [, fallback]
$pconv->convert($string [, reset])
$pconv->reset
$pconv->convert_fresh($string)


SEE ALSO

the PApp manpage.


AUTHOR

 Marc Lehmann <pcg@goof.com>
 http://www.goof.com/pcg/marc/