From dbdcc893abd1fcc543bf256c3428f7eee0896e10 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 10 Jul 2012 16:50:39 +0200 Subject: [PATCH] Accept a new 'charset' argument --- lib/Email/Simple/Markdown.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Email/Simple/Markdown.pm b/lib/Email/Simple/Markdown.pm index 01d8f06..9d5854c 100644 --- a/lib/Email/Simple/Markdown.pm +++ b/lib/Email/Simple/Markdown.pm @@ -66,6 +66,11 @@ stylesheet, wrapped by a I tag. See C. +=item charset => $charset + +The character set supplied to Ccreate()>. By default, no character set +is passed. + =back @@ -74,10 +79,11 @@ See C. sub create { my ( $self, %arg ) = @_; - my @local_args = qw/ css markdown_engine pre_markdown_filter /; + my @local_args = qw/ css markdown_engine pre_markdown_filter charset /; my %md_arg; @md_arg{@local_args} = delete @arg{@local_args}; + $self->{_md_charset} = $md_arg{charset}; my $css = delete $arg{css}; my $email = $self->SUPER::create(%arg); @@ -243,12 +249,13 @@ sub with_markdown { $mail->parts_set([ Email::MIME->create( - attributes => { content_type => 'text/plain' }, + attributes => { content_type => 'text/plain', charset => $self->{_md_charset} }, body => $body, ), Email::MIME->create( attributes => { content_type => 'text/html', + charset => $self->{_md_charset}, encoding => 'quoted-printable', }, body => $markdown,