【发布时间】:2013-01-29 09:29:03
【问题描述】:
这是否正常工作?有些错误消息已经解码,有些需要解码才能得到正确的输出。
#!/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( $@ );
}
}
【问题讨论】:
-
消息输出是否正确?如果是,它可能正在工作。