summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-03-05 14:29:41 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-05 14:29:41 +0000
commit550b4c192a7ab403f3e0188e96ad1e2b9da72d36 (patch)
tree0a36b112f8aad904e9a96d6b945077ce374567c2
parent97e322ff169812aac5db3010a41269f2b1e7fae7 (diff)
downloadperl-550b4c192a7ab403f3e0188e96ad1e2b9da72d36.tar.gz
Remove HanZi and 7bit-kr, from SADAHIRO Tomoyuki.
p4raw-id: //depot/perl@15045
-rw-r--r--MANIFEST2
-rw-r--r--ext/Encode/Encode/7bit-kr.enc7
-rw-r--r--ext/Encode/lib/Encode/Tcl.pm4
-rw-r--r--ext/Encode/lib/Encode/Tcl/HanZi.pm151
4 files changed, 1 insertions, 163 deletions
diff --git a/MANIFEST b/MANIFEST
index b6e5bd3e59..5f7e71201f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -212,7 +212,6 @@ ext/Encode/Encode/2022.enc Encode table
ext/Encode/Encode/7bit-greek.enc Encode table
ext/Encode/Encode/7bit-jis.enc Encode table
ext/Encode/Encode/7bit-kana.enc Encode table
-ext/Encode/Encode/7bit-kr.enc Encode table
ext/Encode/Encode/7bit-latin1.enc Encode table
ext/Encode/Encode/8859-1.enc Encode table
ext/Encode/Encode/8859-1.ucm Encode table
@@ -349,7 +348,6 @@ ext/Encode/lib/Encode/JP/Tr.pm Encode extension
ext/Encode/lib/Encode/Tcl.pm Encode extension
ext/Encode/lib/Encode/Tcl/Escape.pm Encode extension
ext/Encode/lib/Encode/Tcl/Extended.pm Encode extension
-ext/Encode/lib/Encode/Tcl/HanZi.pm Encode extension
ext/Encode/lib/Encode/Tcl/Table.pm Encode extension
ext/Encode/lib/Encode/ucs2_le.pm Encode extension
ext/Encode/lib/Encode/Unicode.pm Encode extension
diff --git a/ext/Encode/Encode/7bit-kr.enc b/ext/Encode/Encode/7bit-kr.enc
deleted file mode 100644
index 30c53952ff..0000000000
--- a/ext/Encode/Encode/7bit-kr.enc
+++ /dev/null
@@ -1,7 +0,0 @@
-# Encoding file: 7bit-kr, escape-driven
-E
-name 7bit-kr
-init \x1b$)C
-final {}
-ascii \x0f
-ksc5601 \x0e
diff --git a/ext/Encode/lib/Encode/Tcl.pm b/ext/Encode/lib/Encode/Tcl.pm
index 916e175854..9ed3fe57d4 100644
--- a/ext/Encode/lib/Encode/Tcl.pm
+++ b/ext/Encode/lib/Encode/Tcl.pm
@@ -103,8 +103,7 @@ sub loadEncoding
}
my $subclass =
($type eq 'X') ? 'Extended' :
- ($type eq 'H') ? 'HanZi' :
- ($type eq 'E') ? 'Escape' : 'Table';
+ ($type eq 'E') ? 'Escape' : 'Table';
my $class = ref($obj) . '::' . $subclass;
# carp "Loading $file";
bless $obj,$class;
@@ -132,7 +131,6 @@ sub INC_find
require Encode::Tcl::Table;
require Encode::Tcl::Escape;
require Encode::Tcl::Extended;
-require Encode::Tcl::HanZi;
1;
__END__
diff --git a/ext/Encode/lib/Encode/Tcl/HanZi.pm b/ext/Encode/lib/Encode/Tcl/HanZi.pm
deleted file mode 100644
index 3a6a5c0d96..0000000000
--- a/ext/Encode/lib/Encode/Tcl/HanZi.pm
+++ /dev/null
@@ -1,151 +0,0 @@
-package Encode::Tcl::HanZi;
-our $VERSION = do {my @r=(q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r};
-use base 'Encode::Encoding';
-
-use Carp;
-
-sub read
-{
- my ($obj,$fh,$name) = @_;
- my(%tbl, @seq, $enc);
- while (<$fh>)
- {
- next unless /^(\S+)\s+(.*)$/;
- my ($key,$val) = ($1,$2);
- $val =~ s/^\{(.*?)\}/$1/g;
- $val =~ s/\\x([0-9a-f]{2})/chr(hex($1))/ge;
- if($enc = Encode->getEncoding($key))
- {
- $tbl{$val} = ref($enc) eq 'Encode::Tcl' ? $enc->loadEncoding : $enc;
- push @seq, $val;
- }
- else
- {
- $obj->{$key} = $val;
- }
- }
- $obj->{'Seq'} = \@seq; # escape sequences
- $obj->{'Tbl'} = \%tbl; # encoding tables
- return $obj;
-}
-
-sub decode
-{
- my ($obj,$str,$chk) = @_;
- my $name = $obj->{'Name'};
- my $tbl = $obj->{'Tbl'};
- my $seq = $obj->{'Seq'};
- my $std = $seq->[0];
- my $cur = $std;
- my $uni;
- while (length($str)){
- my $cc = substr($str,0,1,'');
- if($cc eq "~")
- {
- if($str =~ s/^\cJ//)
- {
- next;
- }
- elsif($str =~ s/^\~//)
- {
- 1; # no-op
- }
- elsif($str =~ s/^([{}])//)
- {
- $cur = "~$1";
- next;
- }
- elsif(! length $str)
- {
- $str = '~';
- last;
- }
- else
- {
- $str =~ s/^([^~])//;
- croak "unknown HanZi escape sequence: ~$1";
- next;
- }
- }
- if(ref($tbl->{$cur}) ne 'Encode::Tcl::Table')
- {
- $uni .= $tbl->{$cur}->decode($cc);
- next;
- }
- my $ch = ord($cc);
- my $rep = $tbl->{$cur}->{'Rep'};
- my $touni = $tbl->{$cur}->{'ToUni'};
- my $x;
- if (&$rep($ch) eq 'C')
- {
- $x = $touni->[0][$ch];
- }
- else
- {
- if(! length $str)
- {
- $str = $cc; # split leading byte
- last;
- }
- my $c2 = substr($str,0,1,'');
- $cc .= $c2;
- $x = $touni->[$ch][ord($c2)];
- }
- unless (defined $x)
- {
- Encode::Tcl::no_map_in_decode($name, $cc.$str);
- }
- $uni .= $x;
- }
- if($chk)
- {
- $_[1] = $cur eq $std ? $str : $cur.$str;
- }
- return $uni;
-}
-
-sub encode
-{
- my ($obj,$uni,$chk) = @_;
- my $name = $obj->{'Name'};
- my $tbl = $obj->{'Tbl'};
- my $seq = $obj->{'Seq'};
- my $std = $seq->[0];
- my $str;
- my $pre = $std;
- my $cur = $pre;
-
- while (length($uni))
- {
- my $ch = substr($uni,0,1,'');
- my $x;
- foreach my $e_seq (@$seq)
- {
- $x = ref($tbl->{$e_seq}) eq 'Encode::Tcl::Table'
- ? $tbl->{$e_seq}->{FmUni}->{$ch}
- : $tbl->{$e_seq}->encode($ch,1);
- $cur = $e_seq and last if defined $x;
- }
- unless (defined $x)
- {
- unless($chk)
- {
- Encode::Tcl::no_map_in_encode(ord($ch), $name)
- }
- return undef;
- }
- if(ref($tbl->{$cur}) eq 'Encode::Tcl::Table')
- {
- my $def = $tbl->{$cur}->{'Def'};
- my $rep = $tbl->{$cur}->{'Rep'};
- $x = pack(&$rep($x),$x);
- }
- $str .= $cur eq $pre ? $x : ($pre = $cur).$x;
- $str .= '~' if $x eq '~'; # to '~~'
- }
- $str .= $std unless $cur eq $std;
- $_[1] = $uni if $chk;
- return $str;
-}
-1;
-__END__