From 49ce8f654e8422ba2f7aea1e2fec9d8da82ffc72 Mon Sep 17 00:00:00 2001 From: Alexey Mahotkin Date: Thu, 20 Nov 2008 15:52:18 +0300 Subject: [PATCH] RFC-2045 and quoted-printable bugfix 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. --- actionmailer/lib/action_mailer/quoting.rb | 2 +- actionmailer/test/test_helper_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionmailer/lib/action_mailer/quoting.rb b/actionmailer/lib/action_mailer/quoting.rb index a2f2c70..94fa042 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 b7f9d9f..9d22bb2 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 -- 1.6.0.2