Ticket #8038: body_charset.patch
| File body_charset.patch, 1.3 kB (added by Theory, 1 year ago) |
|---|
-
test/mail_service_test.rb
old new 803 803 def test_multipart_with_template_path_with_dots 804 804 mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient) 805 805 assert_equal 2, mail.parts.length 806 assert_equal 'text/plain', mail.parts[0].content_type 807 assert_equal 'utf-8', mail.parts[0].charset 806 808 end 807 809 808 810 def test_custom_content_type_attributes -
lib/action_mailer/part_container.rb
old new 41 41 private 42 42 43 43 def parse_content_type(defaults=nil) 44 return [defaults && defaults.content_type, {}] if content_type.blank? 44 if content_type.blank? 45 return defaults ? 46 [ defaults.content_type, { 'charset' => defaults.charset } ] : 47 [ nil, {} ] 48 end 45 49 ctype, *attrs = content_type.split(/;\s*/) 46 50 attrs = attrs.inject({}) { |h,s| k,v = s.split(/=/, 2); h[k] = v; h } 47 51 [ctype, {"charset" => charset || defaults && defaults.charset}.merge(attrs)]