From bddf3b5c2c6197bd010a5bb31ebd322b8ed11302 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 17 Jan 2010 11:00:54 +0000 Subject: [PATCH] Adds a test with Japanese keywords in a ISO-2002-JP encoded email (#4576). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3322 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../japanese_keywords_iso_2022_jp.eml | 60 +++++++++++++++++++ test/unit/mail_handler_test.rb | 8 +++ 2 files changed, 68 insertions(+) create mode 100644 test/fixtures/mail_handler/japanese_keywords_iso_2022_jp.eml diff --git a/test/fixtures/mail_handler/japanese_keywords_iso_2022_jp.eml b/test/fixtures/mail_handler/japanese_keywords_iso_2022_jp.eml new file mode 100644 index 00000000..21c5c12b --- /dev/null +++ b/test/fixtures/mail_handler/japanese_keywords_iso_2022_jp.eml @@ -0,0 +1,60 @@ +Message-ID: <001101ca9762$293d68c0$0600a8c0@osiris> +From: "jsmith" +To: +Subject: Japanese Character pattern matching +Date: Sun, 17 Jan 2010 11:45:18 +0100 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_000E_01CA976A.8AF5E9E0" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 6.00.2900.2869 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 + +This is a multi-part message in MIME format. + +------=_NextPart_000_000E_01CA976A.8AF5E9E0 +Content-Type: text/plain; + charset="iso-2022-jp" +Content-Transfer-Encoding: quoted-printable + +It should be noted that I am receiving emails using pop and the patch in = +Issue #2420 but I don't think the problem lies with this. + +When I try and send emails to the redmine server with Japanese = +characters in them it appears to work apart from the pattern matching. + +For example if I send an email with the following keywords. + +Tracker: =1B$B3+H/=1B(B + +------=_NextPart_000_000E_01CA976A.8AF5E9E0 +Content-Type: text/html; + charset="iso-2022-jp" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
+

It should be noted that I am receiving emails using pop and the patch = +in=20 +Issue #2420 but I don't think = +the=20 +problem lies with this.

+

When I try and send emails to the redmine server with Japanese = +characters in=20 +them it appears to work apart from the pattern matching.

+

For example if I send an email with the following keywords.

+

Tracker: = +=1B$B3+H/=1B(B

+ +------=_NextPart_000_000E_01CA976A.8AF5E9E0-- + diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 21d2aedd..ae199bc0 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -209,6 +209,14 @@ class MailHandlerTest < ActiveSupport::TestCase Role.anonymous.add_permission!(:add_issues) assert_equal false, submit_email('ticket_without_from_header.eml') end + + def test_add_issue_with_japanese_keywords + tracker = Tracker.create!(:name => '開発') + Project.find(1).trackers << tracker + issue = submit_email('japanese_keywords_iso_2022_jp.eml', :issue => {:project => 'ecookbook'}, :allow_override => 'tracker') + assert_kind_of Issue, issue + assert_equal tracker, issue.tracker + end def test_should_ignore_emails_from_emission_address Role.anonymous.add_permission!(:add_issues)