From 14c02f50cc44ec1c6c21614f4563136aff01364f 2014-02-17 12:42:44 From: Toshi MARUYAMA Date: 2014-02-17 12:42:44 Subject: [PATCH] add test of quoted printable UTF-8 mail reviving (#14675) git-svn-id: http://svn.redmine.org/redmine/trunk@12901 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/fixtures/mail_handler/quoted_printable_utf8.eml b/test/fixtures/mail_handler/quoted_printable_utf8.eml new file mode 100644 index 0000000..ae31ffc --- /dev/null +++ b/test/fixtures/mail_handler/quoted_printable_utf8.eml @@ -0,0 +1,19 @@ +Date: Tue, 13 Aug 2013 10:56:04 +0700 +From: John Smith +Content-Type: multipart/alternative; boundary=001a11c260fa53f8dc04e3cc380b +Subject: issue 14675 +To: redmine@somenet.foo + +--001a11c260fa53f8dc04e3cc380b +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +Freundliche Gr=C3=BCsse + +--001a11c260fa53f8dc04e3cc380b +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +
Freundliche Gr=C3=BCsse
+ +--001a11c260fa53f8dc04e3cc380b-- diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 8b2f6e2..09b37e0 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -529,6 +529,17 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal str, issue.subject end + def test_quoted_printable_utf8 + issue = submit_email( + 'quoted_printable_utf8.eml', + :issue => {:project => 'ecookbook'} + ) + assert_kind_of Issue, issue + str = "Freundliche Gr\xc3\xbcsse" + str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) + assert_equal str, issue.description + end + def test_add_issue_with_japanese_subject issue = submit_email( 'subject_japanese_1.eml',