broken subject when submitting issue via email written in japanese
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.
#2 Updated by Nobuhiro IMAI over 8 years ago
- File mail_hander_broken_attachment_filename.diff added
- Status changed from Closed to Reopened
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 => "あいうえお"
#4 Updated by Ignacio Carrera over 8 years ago
Ignacio Carrera wrote:
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).
Jean Philippe seems to have fixed it in sandbox some months ago...