Skip to content

Commit

Permalink
Fixed RFC-2045 quoted-printable bug [rails#1421 state:committed]
Browse files Browse the repository at this point in the history
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
squadette authored and dhh committed Nov 20, 2008
1 parent ebdbd85 commit 8458365
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions 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]


Expand Down
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer/quoting.rb
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion actionmailer/test/test_helper_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8458365

Please sign in to comment.