From 053cb22c17b42bdd4bf60a96fbe73df332430556 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 22 Jun 2005 10:12:06 +0000 Subject: Use the real charset for parts generated by a template, instead of the string "charset". git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/base.rb | 2 +- actionmailer/test/mail_service_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 20911513d0..7154dbdc93 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -178,7 +178,7 @@ module ActionMailer #:nodoc: type = (File.basename(path).split(".")[1..-2] || []).join("/") next if type.empty? @parts << Part.new(:content_type => type, - :disposition => "inline", :charset => "charset", + :disposition => "inline", :charset => charset, :body => render_message(File.basename(path).split(".")[0..-2].join('.'), @body)) end end diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index b61565023c..8eb001ab25 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -479,7 +479,9 @@ EOF mail = TestMailer.create_implicitly_multipart_example(@recipient) assert_equal 2, mail.parts.length assert_equal "text/html", mail.parts[0].content_type + assert_equal "utf-8", mail.parts[0].sub_header("content-type", "charset") assert_equal "text/plain", mail.parts[1].content_type + assert_equal "utf-8", mail.parts[1].sub_header("content-type", "charset") end def test_html_mail -- cgit v1.2.3