これは正しく機能しますか?一部のエラーメッセージはすでにデコードされており、デコードする必要があるものもありますが、正しい出力が得られます。
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;
use open qw(:utf8 :std);
use Encode qw(decode_utf8);
# ...
if ( not eval{
# some error-messages (utf8) are decoded some are not
1 }
) {
if ( utf8::is_utf8 $@ ) {
print $@;
}
else {
print decode_utf8( $@ );
}
}