#!/usr/bin/env perl

use warnings;
use strict;
use utf8;

use Mail::Message;

open IN, '<:raw', 'in.msg' or die;
my $msg = Mail::Message->read(\*IN);

my $dec =  $msg->decoded(charset => 'PERL');
#print ref($dec), "\n";
#print "IS UTF8? ", utf8::is_utf8("$dec") ? 'yes' : 'no', "\n";
#print "IS UTF8? ", utf8::is_utf8($dec->string) ? 'yes' : 'no', "\n";
#print "IS UTF8? ", utf8::is_utf8(($dec->lines)[1]) ? 'yes' : 'no', "\n";
#print "IS UTF8? ", utf8::is_utf8($dec->{MMBL_array}[1]) ? 'yes' : 'no', "\n";

print "$dec";

