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

NAME

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

VERSION

$LastChangedRevision$

DATE

$LastChangedDate: 2005-05-10 08:39:20 -0700 (Tue, 10 May 2005) $

SYNOPSIS

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

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

  # (note: this is only in-place now -- it used to also return the string)
  $chartrans->to_utf8(\$some_data);
  $chartrans->from_utf8(\$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

Throws:

*
Unspecified charset
*
Unknown charset Side Effects: Notes: Use new() to get a working CharTrans object.

Public Class Methods

None.

Public Instance Methods

Gets the current target character set in use. Optionally sets the current character set. Throws: NONE. Side Effects: NONE. Notes: NONE. Performs an in-place conversion of the data in CW$somedata from the character set specified via CWcharset() to UTF-8. References to SCALARs, ARRAYs, and HASHes will be recursively processed and their data replaced. Throws:

Error converting data from [charset] to utf-8.
Side Effects: NONE. Notes: This used to return the converted string, but it doesn't any more. Instead, it returns the Bric::Util::CharTrans object itself. Performs an in-place conversion of the UTF-8 data in CW$utf8_text to the character set specified via CWcharset(). References to SCALARs, ARRAYs, and HASHes will be recursively processed and their data replaced. Throws:
Error converting data from utf-8 to [charset].
Side Effects: NONE. Notes: This used to return the converted string, but it doesn't any more. Instead, it returns the Bric::Util::CharTrans object itself.

NOTES

None.

AUTHORS

Paul Lindner <lindner@inuus.com>, David Wheeler <david@kineticode.com>

SEE ALSO

Bric, Encode