From: Robin Barker Date: Fri, 23 May 2003 17:37:09 +0000 (+0100) Subject: for Configure -Dnoextensions=Encode X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54cfe9430e7706de0a1d08138e242eb6c92b15c8;p=p5sagit%2Fp5-mst-13.2.git for Configure -Dnoextensions=Encode Message-ID: <533D273D4014D411AB1D00062938C4D90404653D@hotel.npl.co.uk> p4raw-id: //depot/perl@19600 --- diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t index cf80af7..06a0ba7 100644 --- a/ext/PerlIO/t/encoding.t +++ b/ext/PerlIO/t/encoding.t @@ -10,6 +10,10 @@ BEGIN { print "1..0 # Skip: not perlio\n"; exit 0; } + unless (eval { require Encode } ) { + print "1..0 # Skip: not Encode\n"; + exit 0; + } } print "1..14\n"; @@ -29,7 +33,6 @@ if (open(GRK, ">$grk")) { } { - use Encode; open(my $i,'<:encoding(iso-8859-7)',$grk); print "ok 1\n"; open(my $o,'>:utf8',$utf); diff --git a/ext/PerlIO/t/fallback.t b/ext/PerlIO/t/fallback.t index 049972e..5842081 100644 --- a/ext/PerlIO/t/fallback.t +++ b/ext/PerlIO/t/fallback.t @@ -10,9 +10,13 @@ BEGIN { print "1..0 # Skip: EBCDIC\n"; exit 0; } + unless( eval { require Encode } ) { + print "1..0 # Skip: No Encode\n"; + exit 0; + } plan (9); + import Encode qw(:fallback_all); } -use Encode qw(:fallback_all); # $PerlIO::encoding = 0; # WARN_ON_ERR|PERLQQ; diff --git a/ext/Storable/t/utf8hash.t b/ext/Storable/t/utf8hash.t index 7d842d5..25fd978 100644 --- a/ext/Storable/t/utf8hash.t +++ b/ext/Storable/t/utf8hash.t @@ -32,7 +32,6 @@ use Storable qw(store nstore retrieve thaw freeze); # point Test::More tidily prints up 1..79 as if I meant to finish there. use Test::More tests=>148; use bytes (); -use Encode qw(is_utf8); my %utf8hash; $Storable::canonical = $Storable::canonical; # Shut up a used only once warning. diff --git a/lib/open.pm b/lib/open.pm index 39e194f..c8bc606 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -80,7 +80,7 @@ sub import { foreach my $layer (split(/\s+/,$dscp)) { $layer =~ s/^://; if ($layer eq 'locale') { - use Encode; + require Encode; _get_locale_encoding() unless defined $locale_encoding; (warnings::warnif("layer", "Cannot figure out an encoding to use"), last) diff --git a/lib/open.t b/lib/open.t index 68b3eca..55b955b 100644 --- a/lib/open.t +++ b/lib/open.t @@ -45,6 +45,7 @@ like( $warn, qr/Unknown PerlIO layer/, SKIP: { skip("no perlio, no :utf8", 1) unless (find PerlIO::Layer 'perlio'); + skip("no Encode for locale layer", 1) unless eval { require Encode }; # now load a real-looking locale $ENV{LC_ALL} = ' .utf8'; import( 'IN', 'locale' );