Patch #2059

broken subject when submitting issue via email written in japanese

Added by Go MAEDA about 9 years ago. Updated over 2 years ago.

Status:ClosedStart date:2008-10-21
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-

Description

TMail class in ActionMailer::Base decodes subject to ISO-2022-JP when the subject is written in Japanese. But it should be utf8 when set to issue.subject. As a result, we get broken subject like the attached picture.

broken_subject.png - broken subject sample (28.6 KB) Go MAEDA, 2008-10-21 14:00

mail_hander_broken_subject.diff Magnifier - patch to address the problem (628 Bytes) Go MAEDA, 2008-10-21 14:00

mail_hander_broken_attachment_filename.diff Magnifier (543 Bytes) Nobuhiro IMAI, 2009-09-24 07:24

Associated revisions

Revision 1990
Added by Jean-Philippe Lang about 9 years ago

Fixed: broken subject when submitting issue via email written in japanese (Patch #2059 by Go MAEDA).

History

#1 Updated by Jean-Philippe Lang about 9 years ago

  • Status changed from New to Closed

Patch applied in r1990. Thanks.

#2 Updated by Nobuhiro IMAI about 8 years ago

The same problem is on the filename of attachment files.
Attached patch fixes this in a similar way to mail_hander_broken_subject.diff.

However, I wonder where the String#toutf8 method came from.
Only kconv.rb (bundled in Ruby 1.8 series) defines String#toutf8,
and Redmine does not require this library, as far as I know.

Just in case, toutf8 from kconv uses nkf internally,
NKF.nkf decodes MIME encoded string automatically.

>> NKF.nkf("-w", "=?iso-2022-jp?B?GyRCJCIkJCQmJCgkKhsoQg==?=")
=> "あいうえお" 
>> "=?iso-2022-jp?B?GyRCJCIkJCQmJCgkKhsoQg==?=".toutf8
=> "あいうえお" 
>> NKF.nkf("-w", "=?utf-8?Q?=E3=81=82=E3=81=84=E3=81=86=E3=81=88=E3=81=8A?=")
=> "あいうえお" 
>> "=?utf-8?Q?=E3=81=82=E3=81=84=E3=81=86=E3=81=88=E3=81=8A?=".toutf8
=> "あいうえお" 

#3 Updated by Ignacio Carrera about 8 years ago

@Nobuhiro, please read #3717 (my comment specifically).

This change broke other non-JP and non-English encodings, plus I believe that TMail was handling your subject correctly (the problem may lie elsewhere).

-- nachokb

#4 Updated by Ignacio Carrera about 8 years ago

Ignacio Carrera wrote:

@Nobuhiro, please read #3717 (my comment specifically).

This change broke other non-JP and non-English encodings, plus I believe that TMail was handling your subject correctly (the problem may lie elsewhere).

-- nachokb

Jean Philippe seems to have fixed it in sandbox some months ago...

#5 Updated by Mischa The Evil about 6 years ago

  • Category set to Email receiving

#6 Updated by Toshi MARUYAMA over 2 years ago

  • Related to deleted (Defect #4608: Mail attachment name encoding is incorectly handled)

#7 Updated by Toshi MARUYAMA over 2 years ago

Original issue is fixed.
#2059#note-2 is duplicate of #4608.

#8 Updated by Toshi MARUYAMA over 2 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF