Subject: | not unicode safe? |
When running this program:
use utf8;
use Email::Simple qw();
use Email::Simple::Creator qw();
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::Mbox qw();
my $email = Email::Simple->create(
header => [
To => 'daxim@localhost',
From => 'daxim@localhost',
Subject => '☺',
],
body => '☺',
);
sendmail($email, {transport => Email::Sender::Transport::Mbox->new()});
... the following warning is printed:
Wide character in print at
/home/daxim/local/lib/perl5/5.10.0/x86_64-linux-thread-multi-ld/IO/Handle.pm
line 406.
The resulting mbox looks like this:
From daxim@localhost Thu Jun 18 16:32:25 2009
To: daxim@localhost
From: daxim@localhost
Subject: ☺
Date: Thu, 18 Jun 2009 16:32:25 +0200
☺
Looks like data is passed through unencoded, and the result is not much
standard conform. I expected the mail to have headers like these:
Subject: =?utf-8?B?4pi6?=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Do I have to do the encoding and header handling on my own?