Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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( $@ );
- }
- }
- # $@ is sometimes encoded. If it's not,
- # the following will leave it unchanged.
- utf8::decode($@);
- print $@;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement