Codex

Locale::RecodeData

Section: User Contributed Perl Documentation (3pm)

Updated: 2013-01-14

Index?action=index Return to Main Contents


NAME

Locale::RecodeData - Abstract Base Class for Charset Converters

SYNOPSIS

DESCRIPTION

The module Locale::RecodeData serves as an abstract base class to all converters used by Locale::Recode?(3).

Adding new conversion modules is currently not straightforward, and you will have to edit the sources of some modules for that purpose.

First, you have to add your new converter class to the list found in Locale::_Conversions?(3), so that Locale::Recode?(3) knows about its presence. If there are valid aliases for the codeset of your converter, you will also have to edit Locale::_Aliases?(3).

Finally, you have to implement the (protected) conversion routine _recode(). See below (``INTERFACE'') for details.

CONSTRUCTOR

new (from => FROM_CODESET', to => TO_CODESET')
The constructor takes two (named) arguments:

:

from
The canonical name of the source codeset. Aliases have already been resolved and the name is converted to uppercase.:
to
The canonical name of the destination codeset. Aliases have already been resolved and the name is converted to uppercase.:

:

You normally don't have to implement the constructor. The default constructor implemented here will store the source and destination codesets in the protected members and .

:

METHODS

The class implements one method:

_getError
Returns the (protected) member .:

INTERFACE

New conversion classes must provide the following interface:

new (from => FROM_CODESET', to => TO_CODESET')
The constructor takes two (named) arguments:

:

from
The canonical name of the source codeset. Aliases have already been resolved and the name is converted to uppercase.:
to
The canonical name of the destination codeset. Aliases have already been resolved and the name is converted to uppercase.:
_getError
Should return the last error (as a string) or false if there was no error.

This method is implemented in the base class already.

:

_recode STRINGREF
Should convert the argument in-place. In case of failure, return false, and make provisions that the method returns an informative error message.:

AUTHOR

Copyright (C) 2002-2013, Guido Flohr <[email protected]>, all rights reserved. See the source code for details.

This software is contributed to the Perl community by Imperia (<http://www.imperia.net/>).

SEE ALSO

(3pm), (3pm), (3pm), perl?(1)

POD ERRORS

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

Around line 178=cut found outside a pod block. Skipping to next block.

Index

NAME

SYNOPSIS

DESCRIPTION

CONSTRUCTOR

METHODS

INTERFACE

AUTHOR

SEE ALSO

POD ERRORS