提交 84583657 编写于 作者: A Alexey Mahotkin 提交者: David Heinemeier Hansson

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: NDavid Heinemeier Hansson <david@loudthinking.com>
上级 ebdbd854
*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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册