.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::CSV::Encoded::Coder::Base 3pm" .TH Text::CSV::Encoded::Coder::Base 3pm "2022-11-19" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::CSV::Encoded::Coder::Base \- Interface for Text::CSV::Encoded coder base class .SH "VERSION" .IX Header "VERSION" version 0.25 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& package Text::CSV::Encoded::Coder::YourCoder; \& \& use base qw( Text::CSV::Encoded::Coder::Base ); \& \& sub decode { \& ... \& } \& \& sub encode { \& ... \& } \& \& sub upgrade { \& ... \& } \& \& sub decode_fields_ref { \& ... \& } \& \& sub encode_fields_ref { \& ... \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used by Text::CSV::Encoded internally. .SH "INTERFACS" .IX Header "INTERFACS" .SS "decode" .IX Subsection "decode" .Vb 3 \& ( $self, $encoding, $str ) = @_; \& .... \& return $decoded_str; .Ve .PP Takes an encoding and a \s-1CSV\s0 string. It must return a Perl string decoded in \f(CW$encoding\fR. In Perl 5.8 or later, if \f(CW$enc\fR is \f(CW\*(C`undef\*(C'\fR or false, the encoding should be utf8. .SS "encode" .IX Subsection "encode" .Vb 3 \& ( $self, $encoding, $str ) = @_; \& .... \& return $encoded_str; .Ve .PP Takes an encoding and a Perl string. It must return a \s-1CSV\s0 string encoded in \f(CW$encoding\fR. In Perl 5.8 or later, if \f(CW$enc\fR is \f(CW\*(C`undef\*(C'\fR or false, the encoding should be utf8. .SS "decode_fields_ref" .IX Subsection "decode_fields_ref" .Vb 1 \& ( $self, $encoding, $arrayref ) = @_; .Ve .PP Takes an encoding and an array reference. It must decoded each array entries in \f(CW$encoding\fR. .SS "encode_fields_ref" .IX Subsection "encode_fields_ref" .Vb 1 \& ( $self, $encoding, $arrayref ) = @_; .Ve .PP Takes an encoding and an array reference. It must encoded each array entries in \f(CW$encoding\fR. .SS "upgrade" .IX Subsection "upgrade" .Vb 1 \& ( $self, $str ) = @_; .Ve .PP In Perl 5.8 or later, it is expected to do \f(CW\*(C`utf8::upgrade\*(C'\fR against \f(CW$str\fR. In older versions, this method may be meaningless and there is no need to implement. See to utf8. .SS "encode_check_value" .IX Subsection "encode_check_value" Setter/Getter for an argument passing to encode. .PP .Vb 1 \& $coder\->encode_check_value( Encode::FB_PERLQQ ); .Ve .SS "decode_check_value" .IX Subsection "decode_check_value" Setter/Getter for an argument passing to decode. .PP .Vb 1 \& $coder\->encode_check_value( Encode::FB_PERLQQ ); .Ve .SH "EXAMPLE" .IX Header "EXAMPLE" Use with Jcode. .PP .Vb 1 \& package Text::CSV::Encoded::Coder::Jcode; \& \& use strict; \& use base qw( Text::CSV::Encoded::Coder::Base ); \& \& use Jcode (); \& \& my $Jcode = Jcode\->new; \& \& my %alias = ( \& \*(Aqshiftjis\*(Aq => \*(Aqsjis\*(Aq, \& \*(Aqeuc\-jp\*(Aq => \*(Aqeuc\*(Aq, \& \*(Aqsjis\*(Aq => \*(Aqsjis\*(Aq, \& \*(Aqeuc\*(Aq => \*(Aqeuc\*(Aq, \& ); \& \& \& sub decode { \& my ( $self, $encoding, $str ) = @_; \& my $enc = $alias{ $encoding }; \& $Jcode\->set( $str, $enc )\->euc; \& } \& \& \& sub encode { \& my ( $self, $encoding, $str ) = @_; \& my $enc = $alias{ $encoding }; \& $Jcode\->set( $str, \*(Aqeuc\*(Aq )\->$enc(); \& } \& \& \& sub decode_fields_ref { \& my ( $self, $encoding, $arrayref ) = @_; \& my $enc = $alias{ $encoding }; \& for ( @$arrayref ) { \& $_ = $Jcode\->set( $_, $enc )\->euc; \& } \& } \& \& \& sub encode_fields_ref { \& my ( $self, $encoding, $arrayref ) = @_; \& my $enc = $alias{ $encoding }; \& for ( @$arrayref ) { \& $_ = $Jcode\->set( $_, \*(Aqeuc\*(Aq )\->$enc(); \& } \& } .Ve .SH "AUTHOR" .IX Header "AUTHOR" Makamaka Hannyaharamitu, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2008\-2013 by Makamaka Hannyaharamitu .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.