1Locale::RecodeData(3) User Contributed Perl DocumentationLocale::RecodeData(3)
2
3
4

NAME

6       Locale::RecodeData - Abstract Base Class for Charset Converters
7

SYNOPSIS

9           # For compatibility with Perl 5.005 and earlier, you must
10           # *use* the module before inheriting from it!
11           use qw (Locale::RecodeData);
12           use base qw (Locale::RecodeData);
13

DESCRIPTION

15       The module Locale::RecodeData serves as an abstract base class to all
16       converters used by Locale::Recode(3).
17
18       Adding new conversion modules is currently not straightforward, and you
19       will have to edit the sources of some modules for that purpose.
20
21       First, you have to add your new converter class to the list found in
22       Locale::_Conversions(3), so that Locale::Recode(3) knows about its
23       presence.  If there are valid aliases for the codeset of your con‐
24       verter, you will also have to edit Locale::_Aliases(3).
25
26       Finally, you have to implement the (protected) conversion routine
27       _recode().  See below ("INTERFACE") for details.
28

CONSTRUCTOR

30       new (from => FROM_CODESET, to => TO_CODESET)
31           The constructor takes two (named) arguments:
32
33           from    The canonical name of the source codeset.  Aliases have
34                   already been resolved and the name is converted to upper‐
35                   case.
36
37           to      The canonical name of the destination codeset.  Aliases
38                   have already been resolved and the name is converted to
39                   uppercase.
40
41           You normally don't have to implement the constructor.  The default
42           constructor implemented here will store the source and destination
43           codesets in the protected members "_from" and "_to".
44

METHODS

46       The class implements one method:
47
48       _getError
49           Returns the (protected) member "_error".
50

INTERFACE

52       New conversion classes must provide the following interface:
53
54       new (from => FROM_CODESET, to => TO_CODESET)
55           The constructor takes two (named) arguments:
56
57           from    The canonical name of the source codeset.  Aliases have
58                   already been resolved and the name is converted to upper‐
59                   case.
60
61           to      The canonical name of the destination codeset.  Aliases
62                   have already been resolved and the name is converted to
63                   uppercase.
64
65       _getError
66           Should return the last error (as a string) or false if there was no
67           error.
68
69           This method is implemented in the base class already.
70
71       _recode STRINGREF
72           Should convert the argument "STRINGREF" in-place.  In case of fail‐
73           ure, return false, and make provisions that the method "_getEr‐
74           ror()" returns an informative error message.
75

AUTHOR

77       Copyright (C) 2002-2004, Guido Flohr <guido@imperia.net>, all rights
78       reserved.  See the source code for details.
79
80       This software is contributed to the Perl community by Imperia
81       (<http://www.imperia.net/>).
82

SEE ALSO

84       Locale::Recode::_Aliases(3pm), Locale::Recode::_Conversions(3pm),
85       Locale::Recode(3pm), perl(1)
86
87
88
89perl v5.8.8                       2006-08-28             Locale::RecodeData(3)
Impressum