##// END OF EJS Templates
Merged r10812 from trunk (#12375)...
Toshi MARUYAMA -
r10589:d5c08680f64a
parent child
Show More
@@ -0,0 +1,7
1 From: John Smith <JSmith@somenet.foo>
2 To: "redmine@somenet.foo" <redmine@somenet.foo>
3 Subject: Re: =?iso-2022-jp?b?GyRCJUYlOSVIGyhCCg=?=
4 Date: Fri, 1 Jun 2012 14:39:38 +0200
5 Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar>
6
7 Fixture
@@ -373,7 +373,8 class MailHandler < ActionMailer::Base
373 373 # try to reencode to utf8 manually with ruby1.8
374 374 begin
375 375 if h = email.header[:subject]
376 if m = h.value.match(/^=\?([^\?]+)\?/)
376 # http://tools.ietf.org/html/rfc2047#section-4
377 if m = h.value.match(/=\?([^\?]+)\?[BbQq]\?/)
377 378 subject = Redmine::CodesetUtil.to_utf8(subject, m[1])
378 379 end
379 380 end
@@ -393,6 +393,17 class MailHandlerTest < ActiveSupport::TestCase
393 393 assert_equal ja, issue.subject
394 394 end
395 395
396 def test_add_issue_with_mixed_japanese_subject
397 issue = submit_email(
398 'subject_japanese_2.eml',
399 :issue => {:project => 'ecookbook'}
400 )
401 assert_kind_of Issue, issue
402 ja = "Re: \xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88"
403 ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding)
404 assert_equal ja, issue.subject
405 end
406
396 407 def test_should_ignore_emails_from_locked_users
397 408 User.find(2).lock!
398 409
General Comments 0
You need to be logged in to leave comments. Login now