diff options
Diffstat (limited to 'cpan/lib/Jcode')
| -rw-r--r-- | cpan/lib/Jcode/H2Z.pm | 8 | ||||
| -rw-r--r-- | cpan/lib/Jcode/Tr.pm | 8 | ||||
| -rw-r--r-- | cpan/lib/Jcode/Unicode/NoXS.pm | 6 | ||||
| -rw-r--r-- | cpan/lib/Jcode/_test.pl | 16 |
4 files changed, 27 insertions, 11 deletions
diff --git a/cpan/lib/Jcode/H2Z.pm b/cpan/lib/Jcode/H2Z.pm index 53c81201..c5706c76 100644 --- a/cpan/lib/Jcode/H2Z.pm +++ b/cpan/lib/Jcode/H2Z.pm @@ -1,5 +1,5 @@ # -# $Id: H2Z.pm,v 0.70 2001/05/15 19:35:59 dankogai Exp $ +# $Id: H2Z.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $ # package Jcode::H2Z; @@ -7,8 +7,8 @@ package Jcode::H2Z; use strict; use vars qw($RCSID $VERSION); -$RCSID = q$Id: H2Z.pm,v 0.70 2001/05/15 19:35:59 dankogai Exp $; -$VERSION = do { my @r = (q$Revision: 0.70 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$RCSID = q$Id: H2Z.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $; +$VERSION = do { my @r = (q$Revision: 0.77 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; use Carp; @@ -157,7 +157,7 @@ sub z2h { my $r_str = shift; my $n = ( $$r_str =~ s( - ($RE{EUC_C}) + ($RE{EUC_C}|$RE{EUC_0212}|$RE{EUC_KANA}) ){ $_Z2D{$1} || $_Z2H{$1} || $1; }eogx diff --git a/cpan/lib/Jcode/Tr.pm b/cpan/lib/Jcode/Tr.pm index e29e29bb..28aac783 100644 --- a/cpan/lib/Jcode/Tr.pm +++ b/cpan/lib/Jcode/Tr.pm @@ -1,5 +1,5 @@ # -# $Id: Tr.pm,v 0.70 2001/05/15 19:35:59 dankogai Exp $ +# $Id: Tr.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $ # package Jcode::Tr; @@ -7,8 +7,8 @@ package Jcode::Tr; use strict; use vars qw($VERSION $RCSID); -$RCSID = q$Id: Tr.pm,v 0.70 2001/05/15 19:35:59 dankogai Exp $; -$VERSION = do { my @r = (q$Revision: 0.70 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$RCSID = q$Id: Tr.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $; +$VERSION = do { my @r = (q$Revision: 0.77 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; use Carp; @@ -48,7 +48,7 @@ sub _maketable{ my @from = $from =~ /$RE{EUC_0212}|$RE{EUC_KANA}|$RE{EUC_C}|[\x00-\xff]/go; my @to = $to =~ /$RE{EUC_0212}|$RE{EUC_KANA}|$RE{EUC_C}|[\x00-\xff]/go; - push @to, $to[-1] x $#from - $#to if $#to < $#from && $opt !~ /d/; + push @to, ($opt =~ /d/ ? '' : $to[-1]) x ($#from - $#to) if $#to < $#from; @_TABLE{@from} = @to; } diff --git a/cpan/lib/Jcode/Unicode/NoXS.pm b/cpan/lib/Jcode/Unicode/NoXS.pm index 44800ea3..ba738989 100644 --- a/cpan/lib/Jcode/Unicode/NoXS.pm +++ b/cpan/lib/Jcode/Unicode/NoXS.pm @@ -1,5 +1,5 @@ # -# $Id: NoXS.pm,v 0.71 2001/05/18 05:14:38 dankogai Exp dankogai $ +# $Id: NoXS.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $ # package Jcode::Unicode::NoXS; @@ -7,8 +7,8 @@ package Jcode::Unicode::NoXS; use strict; use vars qw($RCSID $VERSION); -$RCSID = q$Id: NoXS.pm,v 0.71 2001/05/18 05:14:38 dankogai Exp dankogai $; -$VERSION = do { my @r = (q$Revision: 0.71 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$RCSID = q$Id: NoXS.pm,v 0.77 2002/01/14 11:06:55 dankogai Exp $; +$VERSION = do { my @r = (q$Revision: 0.77 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; use Carp; diff --git a/cpan/lib/Jcode/_test.pl b/cpan/lib/Jcode/_test.pl new file mode 100644 index 00000000..7b8bb80d --- /dev/null +++ b/cpan/lib/Jcode/_test.pl @@ -0,0 +1,16 @@ + +use ExtUtils::testlib; +use Jcode::Unicode; +use Getopt::Std; +getopts("p"); + +my $file = "../t/table.euc"; +my $euc, $ucs2, $utf8; +open F, $file or die $!; +read F, $euc, -s $file; + +print "1..2\n"; +print "Ok 1\n" if $ucs2 = Jcode::Unicode::euc_ucs2($euc, $opt_p); +print "Ok 2\n" if $euc eq Jcode::Unicode::ucs2_euc($ucs2, $opt_p); +print "Ok 3\n" if $utf8 = Jcode::Unicode::ucs2_utf8($ucs2); +print "Ok 4\n" if $ucs2 eq Jcode::Unicode::utf8_ucs2($utf8); |
