Patch #2059
broken subject when submitting issue via email written in japanese
| Status: | Reopened | Start date: | 2008-10-21 | |
|---|---|---|---|---|
| Priority: | Normal | Due 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.
Related issues
Associated revisions
Fixed: broken subject when submitting issue via email written in japanese (Patch #2059 by Go MAEDA).
History
#1 Updated by Jean-Philippe Lang over 4 years ago
- Status changed from New to Closed
Patch applied in r1990. Thanks.
#2 Updated by Nobuhiro IMAI over 3 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
=> "あいうえお"
#3 Updated by Ignacio Carrera over 3 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 over 3 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 over 1 year ago
- Category set to Email receiving