[Jifty-commit] r3702 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Thu Jul 19 15:23:12 EDT 2007
Author: trs
Date: Thu Jul 19 15:23:09 2007
New Revision: 3702
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Notification.pm
Log:
r25574 at zot: tom | 2007-07-19 15:22:29 -0400
Make sure we get UTF-8
Modified: jifty/trunk/lib/Jifty/Notification.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Notification.pm (original)
+++ jifty/trunk/lib/Jifty/Notification.pm Thu Jul 19 15:23:09 2007
@@ -7,6 +7,7 @@
use Email::Send ();
use Email::MIME::Creator;
use Email::MIME::CreateHTML;
+use Email::MIME::Modifier;
__PACKAGE__->mk_accessors(
qw/body html_body preface footer subject from _recipients _to_list to/);
@@ -98,6 +99,9 @@
return unless ($to);
my $message = "";
my $appname = Jifty->config->framework('ApplicationName');
+
+ my %attrs = ( charset => 'UTF-8' );
+
if ($self->html_body) {
$message = Email::MIME->create_html(
header => [
@@ -105,12 +109,16 @@
To => $to,
Subject => Encode::encode('MIME-Header', $self->subject || _("A notification from %1!",$appname )),
],
- attributes => { charset => 'UTF-8' },
+ attributes => \%attrs,
+ text_body_attributes => \%attrs,
+ body_attributes => \%attrs,
text_body => $self->full_body,
body => $self->full_html,
embed => 0,
inline_css => 0
);
+ # Since the containing messsage will still be us-ascii otherwise
+ $message->charset_set( $attrs{'charset'} );
} else {
$message = Email::MIME->create(
header => [
@@ -118,7 +126,7 @@
To => $to,
Subject => Encode::encode('MIME-Header', $self->subject || _("A notification from %1!",$appname )),
],
- attributes => { charset => 'UTF-8' },
+ attributes => \%attrs,
parts => $self->parts
);
More information about the Jifty-commit
mailing list