-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ISO-2022-JP-MS encoding convert #7091
Conversation
Is it a PHP bug? Could you provide some samples/steps to reproduce the issue? Create some unit tests? |
This is not a PHP bug. Related to this issue. Use this plugin. Change send charset to ISO-2022-JP. If I send a message with subject, body or to/cc address name that contain Japanese characters including ISO-2022-JP-MS characters like '①②③', Japanese characters are removed or corrupted. I'll try to add unit tests. |
ISO-2022-JP-MS characters are removed by iconv on sending mail. Use mbstring functions on sending. Add a unit test.
A message with ISO-2022-JP-MS characters currupts by wordwrap. Use ISO-2022-JP-MS charset in wordwrap. Add a unit test.
Convert to UTF-8 to split addresses correctly. Base64 encode ISO-2022-JP name. Add a unit test.
I've split patches and add a test for each change. |
mb_internal_encoding($mb_charset); | ||
$name = preg_replace('/^"(.*)"$/', '$1', $name); | ||
$name = mb_encode_mimeheader($name, $mb_charset, $head_encoding_mode, "\r\n", 8); | ||
mb_internal_encoding(RCUBE_CHARSET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part could be replaced by Mail_mimePart::encodeMB()
if
pear/Mail_Mime#18 was accepted.
Whay don't you just set the sendcharset to ISO-2022-JP-MS? |
Whay don't you just set the sendcharset to ISO-2022-JP-MS
Mailer such as Thunderbird cannot convert encoding of Base64 header string contains
=?ISO-2022-JP-MS?B? properly.
ISO-2022-JP-MS looks like not standard charset name for email.
And Thunderbird cannot display message body with `Content-Type: text/plain; charset=ISO-2022-JP-MS` header properly.
|
@alecpl We have upgraded our roundcube to 1.4 with the patches. It works fine. This company seems to fix some Japanese encoding problems for enterprise support. |
@shirosaki Am I passing your point along all right? |
@sanmai You are right. |
ISO-2022-JP-MS characters are removed by iconv on sending mail.
Use mbstring functions on sending.
A message with ISO-2022-JP-MS characters currupts by wordwrap.
Use ISO-2022-JP-MS charset in wordwrap.