1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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>
This commit is contained in:
Alexey Mahotkin 2008-11-20 15:52:18 +03:00 committed by David Heinemeier Hansson
parent ebdbd854a9
commit 84583657f4
3 changed files with 4 additions and 2 deletions

View file

@ -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]

View file

@ -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

View file

@ -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