/[suikacvs]/test/oldencodeutils/lib/Encode/ISO2022/EightBit.pm
Suika

Diff of /test/oldencodeutils/lib/Encode/ISO2022/EightBit.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Mon Sep 16 02:17:48 2002 UTC revision 1.5 by wakaba, Sat Oct 12 07:27:01 2002 UTC
# Line 20  require Encode::ISO2022; Line 20  require Encode::ISO2022;
20  sub encode ($$;$) {  sub encode ($$;$) {
21    my ($obj, $str, $chk) = @_;    my ($obj, $str, $chk) = @_;
22    $_[1] = '' if $chk;    $_[1] = '' if $chk;
23      if (!defined $obj->{_encode_mapping} || $obj->{_encode_mapping}) {
24        require Encode::Table;
25        $str = Encode::Table::convert ($str, $obj->__encode_map,
26          -autoload => defined $obj->{_encode_mapping_autoload} ?
27                       $obj->{_encode_mapping_autoload} : 1);
28      }
29    $str = &Encode::ISO2022::internal_to_iso2022 ($str, $obj->__2022_encode);    $str = &Encode::ISO2022::internal_to_iso2022 ($str, $obj->__2022_encode);
30    return $str;    $str;
31  }  }
32    
33  sub decode ($$;$) {  sub decode ($$;$) {
34    my ($obj, $str, $chk) = @_;    my ($obj, $str, $chk) = @_;
35    $_[1] = '' if $chk;    $_[1] = '' if $chk;
36    return &Encode::ISO2022::iso2022_to_internal ($str, $obj->__2022_decode);    $str = &Encode::ISO2022::iso2022_to_internal ($str, $obj->__2022_decode);
37      if (!defined $obj->{_decode_mapping} || $obj->{_decode_mapping}) {
38        require Encode::Table;
39        $str = Encode::Table::convert ($str, $obj->__decode_map,
40          -autoload => defined $obj->{_decode_mapping_autoload} ?
41                       $obj->{_decode_mapping_autoload} : 1);
42      }
43      $str;
44  }  }
45    
46  ## prototype for EUCs  ## prototype for EUCs
# Line 57  sub __2022_decode ($) { Line 70  sub __2022_decode ($) {
70    my $C = shift->__2022__common;    my $C = shift->__2022__common;
71    $C;    $C;
72  }  }
73    sub __encode_map ($) {
74      [];
75    }
76    sub __decode_map ($) {
77      [];
78    }
79    
80    sub __clone ($) {
81      my $self = shift;
82      bless {%$self}, ref $self;
83    };
84    
85  package Encode::ISO2022::EightBit::EUCJapanOld;