2 # tests that utf8_heavy.pl doesn't use anything that prevents it loading
12 fresh_perl_is(<<'EOP', "", { stderr => 1 }, "doesn't break with \${^ENCODING}");
13 no warnings qw(deprecated);
16 # stolen from Encode.pm
17 my ( undef, undef, undef, $pos, $trm ) = @_;
18 my ( $rdst, $rsrc, $rpos ) = \@_[ 1, 2, 3 ];
20 if ( ( my $npos = index( $$rsrc, $trm, $pos ) ) >= 0 ) {
22 substr( $$rsrc, $pos, $npos - $pos + length($trm) );
23 $$rpos = $npos + length($trm);
26 $$rdst .= substr( $$rsrc, $pos );
27 $$rpos = length($$rsrc);
32 my (undef, $tmp) = @_;
37 BEGIN { ${^ENCODING} = bless [], q(Foo) };
39 (my $tmp = q(abc)) =~ tr/abc/123/;