Data-Structure-Util

 view release on metacpan or  search on metacpan

t/04utf8.t  view on Meta::CPAN

is( utf8_on( $string2 ),  $string2, "Got string back" );
is( utf8_off( $string ),  $string,  "Got string back" );
is( utf8_off( $string2 ), $string2, "Got string back" );

ok( !has_utf8( $hash ), "Has not utf8" );
ok( has_utf8( $hash2 ), "Has utf8" );
is( has_utf8( $hash2 ), $hash2, "Has utf8" );

is( $hash2->{key1}, $hash->{key1}, "Same string" );
ok( !compare( $hash2->{key1}, $hash->{key1} ), "Different encoding" );
ok( utf8_off( $hash2 ),  "Have decoded utf8" );
ok( !has_utf8( $hash2 ), "Has not utf8" );
is( $hash2->{key1}, $hash->{key1}, "Same string" );
ok( compare( $hash2->{key1}, $hash->{key1} ), "Same encoding" );

ok( utf8_on( $hash ), "Have encoded utf8" );
is( $hash2->{key1}, $hash->{key1}, "Same string" );
ok( !compare( $hash2->{key1}, $hash->{key1} ), "Different encoding" );

sub compare {
    my $str1   = shift;



( run in 0.787 second using v1.01-cache-2.11-cpan-26ccb49234f )