* Dmitry Bigunyak via RT (bug-Mail-Box@rt.cpan.org) [091127 09:16]:
Show quoted text> Fri Nov 27 04:16:18 2009: Request 52115 was acted upon.
> Transaction: Ticket created by Alien
> Queue: Mail-Box
> Subject: Mail::Message::Field::Address->coerce doesn't use any passed OPTIONS
>
> The example below doesn't sense input options charset and encoding.
>
> my $to = 'Веселая Работка <dima@mailbox.ru>';
> my ($ma) = Mail::Address->parse($to);
> my $to_address = Mail::Message::Field::Address->coerce($ma, charset =>
> 'utf-8', encoding => 'B');
>
> As opposed to this example:
> my $to_address = Mail::Message::Field::Address->new(address =>
> 'dima@mailbox.ru', phrase => "Веселая Работка", charset => 'utf-8',
> encoding => 'B');
That's a genuine bug.
Can you try this change in Mail::Message::Field::Address:
sub coerce($@)
{ my ($class, $addr, %args) = @_;
return () unless defined $addr;
return $class->parse($addr) unless ref $addr;
return $addr if $addr->isa($class);
- my $from = $class->from($addr);
+ my $from = $class->from($addr, %args);
Mail::Reporter->log(ERROR => "Cannot coerce a ".ref($addr)." into a $class"),
return () unless defined $from;
bless $from, $class;
}
Probably, the last "bless" is not needed either.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net