Project

General

Profile

Actions

Patch #2059

closed

broken subject when submitting issue via email written in japanese

Added by Go MAEDA over 15 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
2008-10-21
Due date:
% Done:

0%

Estimated time:

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.


Files

broken_subject.png (28.6 KB) broken_subject.png broken subject sample Go MAEDA, 2008-10-21 14:00
mail_hander_broken_subject.diff (628 Bytes) mail_hander_broken_subject.diff patch to address the problem Go MAEDA, 2008-10-21 14:00
mail_hander_broken_attachment_filename.diff (543 Bytes) mail_hander_broken_attachment_filename.diff Nobuhiro IMAI, 2009-09-24 07:24
Actions #1

Updated by Jean-Philippe Lang over 15 years ago

  • Status changed from New to Closed

Patch applied in r1990. Thanks.

Actions #2

Updated by Nobuhiro IMAI over 14 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
=> "あいうえお" 
Actions #3

Updated by Ignacio Carrera over 14 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

Actions #4

Updated by Ignacio Carrera over 14 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...

Actions #5

Updated by Mischa The Evil over 12 years ago

  • Category set to Email receiving
Actions #6

Updated by Toshi MARUYAMA almost 9 years ago

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

Updated by Toshi MARUYAMA almost 9 years ago

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

Actions #8

Updated by Toshi MARUYAMA almost 9 years ago

  • Status changed from Reopened to Closed
Actions

Also available in: Atom PDF