aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Mahotkin <squadette@gmail.com>2008-11-20 15:52:18 +0300
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-20 23:10:15 +0100
commit84583657f40e5554c496fb24dfbc1921f11b0498 (patch)
tree264d35f4d205fef45d17fffe913fa99d3dfa8b23
parentebdbd854a92ff0594c9af53432d70de882b1c7d1 (diff)
downloadrails-84583657f40e5554c496fb24dfbc1921f11b0498.tar.gz
rails-84583657f40e5554c496fb24dfbc1921f11b0498.tar.bz2
rails-84583657f40e5554c496fb24dfbc1921f11b0498.zip
Fixed RFC-2045 quoted-printable bug [#1421 state:committed]
http://www.faqs.org/rfcs/rfc2045.html says: may be represented by an "=" followed by a two digit hexadecimal representation of the octet's value. The digits of the hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". Uppercase letters must be used; lowercase letters are not allowed. ActionMailer, however, used "=%02x" specification. Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
-rw-r--r--actionmailer/CHANGELOG2
-rw-r--r--actionmailer/lib/action_mailer/quoting.rb2
-rw-r--r--actionmailer/test/test_helper_test.rb2
3 files changed, 4 insertions, 2 deletions
diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG
index 8345345a43..5dc7a33f55 100644
--- a/actionmailer/CHANGELOG
+++ b/actionmailer/CHANGELOG
@@ -1,5 +1,7 @@
*2.3.0 [Edge]*
+* Fixed RFC-2045 quoted-printable bug #1421 [squadette]
+
* Fixed that no body charset would be set when there are attachments present #740 [Paweł Kondzior]
diff --git a/actionmailer/lib/action_mailer/quoting.rb b/actionmailer/lib/action_mailer/quoting.rb
index a2f2c70799..94fa042002 100644
--- a/actionmailer/lib/action_mailer/quoting.rb
+++ b/actionmailer/lib/action_mailer/quoting.rb
@@ -12,7 +12,7 @@ module ActionMailer
# account multi-byte characters (if executing with $KCODE="u", for instance)
def quoted_printable_encode(character)
result = ""
- character.each_byte { |b| result << "=%02x" % b }
+ character.each_byte { |b| result << "=%02X" % b }
result
end
diff --git a/actionmailer/test/test_helper_test.rb b/actionmailer/test/test_helper_test.rb
index b7f9d9f8d3..9d22bb26bd 100644
--- a/actionmailer/test/test_helper_test.rb
+++ b/actionmailer/test/test_helper_test.rb
@@ -36,7 +36,7 @@ class TestHelperMailerTest < ActionMailer::TestCase
end
def test_encode
- assert_equal "=?utf-8?Q?=0aasdf=0a?=", encode("\nasdf\n")
+ assert_equal "=?utf-8?Q?=0Aasdf=0A?=", encode("\nasdf\n")
end
def test_assert_emails