Permalink
Browse files

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>
  • Loading branch information...
1 parent ebdbd85 commit 84583657f40e5554c496fb24dfbc1921f11b0498 @squadette squadette committed with dhh Nov 20, 2008
Showing with 4 additions and 2 deletions.
  1. +2 −0 actionmailer/CHANGELOG
  2. +1 −1 actionmailer/lib/action_mailer/quoting.rb
  3. +1 −1 actionmailer/test/test_helper_test.rb
View
@@ -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]
@@ -12,7 +12,7 @@ def quoted_printable(text, charset)
# 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
@@ -36,7 +36,7 @@ def test_charset_is_utf_8
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

0 comments on commit 8458365

Please sign in to comment.