public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Fixed that no body charset would be set when there are attachments present [#740 
state:commited] (Paweł Kondzior)
dhh (author)
Sat Nov 15 02:05:44 -0800 2008
commit  f46780a0b487c8da5f656254321add04165a11c6
tree    5d2cb2d3c0212e4b17aa1aa5a05ba0922dedd037
parent  44c3b865ac52a7c9a6312982ba0f6c20d7ad41e1
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+*2.3.0/3.0*
0
+
0
+* Fixed that no body charset would be set when there are attachments present #740 [PaweÅ‚ Kondzior]
0
+
0
+
0
 *2.2.1 [RC2] (November 14th, 2008)*
0
 
0
 * Turn on STARTTLS if it is available in Net::SMTP (added in Ruby 1.8.7) and the SMTP server supports it (This is required for Gmail's SMTP server) #1336 [Grant Hollingworth]
...
41
42
43
44
 
 
 
 
 
45
46
47
...
41
42
43
 
44
45
46
47
48
49
50
51
0
@@ -41,7 +41,11 @@ module ActionMailer
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)]
...
915
916
917
 
 
918
919
920
...
915
916
917
918
919
920
921
922
0
@@ -915,6 +915,8 @@ EOF
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