NAME

Bric::Util::CharTrans - Interface to Bricolage UTF-8 Character Translations

VERSION

$Revision: 1.1.1.1.2.2 $

DATE

$Date: 2001/11/06 23:18:34 $

SYNOPSIS

# Constructors.
my $chartrans = Bric::Util::CharTrans->new('iso-8859-1');

# Instance Methods.
my $charset     = $chartrans->charset();
my $charset     = $chartrans->charset('iso-8859-1');

my $utf8_text   = $chartrans->to_utf8($target_text);
my $target_text = $chartrans->from_utf8($utf8_text); 

$chartrans->to_utf(\$some_data);
$chartrans->from_utf(\$some_data);

DESCRIPTION

Bric::Util::CharTrans provides an object-oriented interface to conversion of characters from a target character set to Unicode UTF-8 and from Unicode UTF-8 to a target character set.

INTERFACE

Constructors

my $chartrans = Bric::Util::CharTrans->new($charset)

Public Class Methods

none

Public Instance Methods

my $utf8_text = $chartrans->to_utf8($somedata, $options);

to_utf8() operates in one of two ways.

If passed a scalar value it returns utf8 text corresponding to text in $sometext that is encoded in the target character set.

If passed a reference it will recursively process the data within and convert it all to UTF-8

$options may contains localized overrides in the future...

Throws: error on text that does not correspond to the specified input text.

Side Effects: NONE.

Notes: NONE.

my $target_text = $chartrans->from_utf8($utf8_text);

Returns utf8 text corresponding to text in $sometext

from_utf8() operates in one of two ways.

If passed a scalar value it returns native charset text corresponding to utf-8 text in $utf8_text.

If passed a reference it will recursively process the data within and convert it all to the target character set.

Silently returns undef if passed undef.

Throws: error on text that does not correspond to the specified input text.

Side Effects: NONE.

Notes: NONE.

my $charset = $chartrans->charset(<$new_charset>);

Gets the current target character set in use.

Optionally sets the current character set.

Throws: error on bad character set / utf8 combinations.

Side Effects: NONE.

Notes: NONE.

PRIVATE

Private Class Methods

NONE.

Private Instance Methods

Private Functions

NONE.

NOTES

AUTHOR

Paul Lindner <lindner@inuus.com>

SEE ALSO

perl(1), Bric (2), iconv(3), /usr/bin/iconv

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 146:

You forgot a '=back' before '=head2'

You forgot a '=back' before '=head2'

Around line 324:

=back doesn't take any parameters, but you said =back 4