use Test::More; use Encode 'encode', 'decode'; my @tests = ( { known => "Hello World", bytes_1141 => "Hello World" }, { known => "\N{LATIN CAPITAL LETTER A WITH DIAERESIS}", bytes_1141 => "{" }, # or whatever { known => "\N{LATIN CAPITAL LETTER U WITH DIAERESIS}", bytes_1141 => "}" }, # or whatever ); plan 3*@tests; for my $test (@tests) { my( $name ) = $test->{name} || $test->{known}; is encode( 'CP1141', $test->{known} ), $test->{bytes_1141}, "Encoding for '$name'" ); is decode( encode( 'CP1141', $test->{known} ), $test->{known}, "Roundtrip for '$name'" ); is decode( 'CP1141', $test->{bytes_1141}), $test->{known}, "Decoding for '$name'" ); }; done_testing;