diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-20 18:15:00 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-20 18:15:00 +0000 |
commit | 5b746edea5a79f1ef864150ab898ec4a2ce169f0 (patch) | |
tree | 4046e429d2d3d34cf0b687331c64b32453f40eb1 /ext/Encode | |
parent | 8e0fc1cdff8c4d07f11a5b0bd5056e1acbe2a68a (diff) | |
parent | 5ed30e05ed3fff2b3516c0be37ef98859920f520 (diff) | |
download | perl-5b746edea5a79f1ef864150ab898ec4a2ce169f0.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@14796
Diffstat (limited to 'ext/Encode')
-rw-r--r-- | ext/Encode/lib/Encode/JP/JIS.pm | 4 | ||||
-rw-r--r-- | ext/Encode/t/JP.t | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/ext/Encode/lib/Encode/JP/JIS.pm b/ext/Encode/lib/Encode/JP/JIS.pm index 6ee3c84549..394a7e62d3 100644 --- a/ext/Encode/lib/Encode/JP/JIS.pm +++ b/ext/Encode/lib/Encode/JP/JIS.pm @@ -2,6 +2,8 @@ package Encode::JP::JIS; use Encode::JP; use base 'Encode::Encoding'; +use strict; + # Just for the time being, we implement jis-7bit # encoding via EUC @@ -14,7 +16,7 @@ sub decode my ($obj,$str,$chk) = @_; my $res = $str; jis_euc(\$res); - return Encode::decode('euc-jp', $euc, $chk); + return Encode::decode('euc-jp', $res, $chk); } sub encode diff --git a/ext/Encode/t/JP.t b/ext/Encode/t/JP.t index e9799dab11..2e38936773 100644 --- a/ext/Encode/t/JP.t +++ b/ext/Encode/t/JP.t @@ -1,11 +1,15 @@ BEGIN { -# chdir 't' if -d 't'; -# @INC = (-d '../../lib' ? '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; require Config; import Config; if ($Config{'extensions'} !~ /\bEncode\b/) { print "1..0 # Skip: Encode was not built\n"; exit 0; } + unless (find PerlIO::Layer 'perlio') { + print "1..0 # Skip: PerlIO was not built\n"; + exit 0; + } $| = 1; } use strict; @@ -23,9 +27,9 @@ ok($enc->isa('Encode::XS')); is($enc->name,'euc-jp'); my $dir = dirname(__FILE__); my $euc = File::Spec->catfile($dir,"table.euc"); -my $utf = File::Spec->catfile($dir,"table.utf8"); +my $utf = File::Spec->catfile($dir,"$$.utf8"); my $ref = File::Spec->catfile($dir,"table.ref"); -my $rnd = File::Spec->catfile($dir,"table.rnd"); +my $rnd = File::Spec->catfile($dir,"$$.rnd"); print "# Basic decode test\n"; open($src,"<",$euc) || die "Cannot open $euc:$!"; ok(defined($src) && fileno($src)); @@ -92,6 +96,5 @@ SKIP: is($enc->name,'euc-jp'); END { -# unlink($utf,$rnd); - + 1 while unlink($utf,$rnd); } |