#!/usr/bin/perl
use warnings;
use strict;

#use utf8;

use lib '../../lib';
#use encoding 'utf8';

use Mail::Message::Body;
use Mail::Message;
use Encode;

my $text = 'тест';
$text = Encode::encode('utf-8', $text);
# Now this is a real utf-8 string "\x{442}\x{435}\x{441}\x{442}"

my $body = Mail::Message::Body->new(
    data      => $text,
    mime_type => 'text/plain',
    charset   => 'utf-8',
);

# trying to add signature
$body = $body->concatenate($body, "-- \n", 'signature');
$body->print;

# And here I get the error:
#Cannot decode string with wide characters at /usr/lib64/perl5/
#site_perl/5.8.8/Mail/Message/Body/Encode.pm line 94.

