public
Fork of josh/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/pkondzior/rails.git
Search Repo:
ActionMailer Does not Set Body Charset When there are Attachments. Closes 
#8038 [Theory]
pkondzior (author)
Mon Apr 28 00:53:31 -0700 2008
commit  1905352909d38c16bccec9f24bd81ed33ba854b5
tree    532aa88187f22b8e2b42f6f429cbe1360caa8d8d
parent  361aaa04ef2f33cb1fe49497c73bc13e6b72addc
...
41
42
43
44
 
 
 
 
 
45
46
47
...
41
42
43
 
44
45
46
47
48
49
50
51
0
@@ -41,7 +41,11 @@
0
     private
0
     
0
       def parse_content_type(defaults=nil)
0
- return [defaults && defaults.content_type, {}] if content_type.blank?
0
+ if content_type.blank?
0
+ return defaults ?
0
+ [ defaults.content_type, { 'charset' => defaults.charset } ] :
0
+ [ nil, {} ]
0
+ end
0
         ctype, *attrs = content_type.split(/;\s*/)
0
         attrs = attrs.inject({}) { |h,s| k,v = s.split(/=/, 2); h[k] = v; h }
0
         [ctype, {"charset" => charset || defaults && defaults.charset}.merge(attrs)]
...
883
884
885
 
 
886
887
888
...
883
884
885
886
887
888
889
890
0
@@ -883,6 +883,8 @@
0
   def test_multipart_with_template_path_with_dots
0
     mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient)
0
     assert_equal 2, mail.parts.length
0
+ assert_equal 'text/plain', mail.parts[0].content_type
0
+ assert_equal 'utf-8', mail.parts[0].charset
0
   end
0
 
0
   def test_custom_content_type_attributes

Comments

    No one has commented yet.