From 869d1d1eafaf92dd2950bb64098ea81d9cd7409d Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Tue, 3 Dec 2019 17:23:22 +0900 Subject: [PATCH] Fix ISO-2022-JP-MS encoding convert ISO-2022-JP-MS characters are removed by iconv on sending mail. Use mbstring functions on sending. Add a unit test. --- program/lib/Roundcube/rcube_charset.php | 2 +- tests/Framework/Charset.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/program/lib/Roundcube/rcube_charset.php b/program/lib/Roundcube/rcube_charset.php index 88eb6001f..5ef78b886 100644 --- a/program/lib/Roundcube/rcube_charset.php +++ b/program/lib/Roundcube/rcube_charset.php @@ -307,7 +307,7 @@ class rcube_charset // convert charset using iconv module if ($iconv_options !== false && $from != 'UTF7-IMAP' && $to != 'UTF7-IMAP' - && $from !== 'ISO-2022-JP' + && $from !== 'ISO-2022-JP' && $to !== 'ISO-2022-JP' ) { // throw an exception if iconv reports an illegal character in input // it means that input string has been truncated diff --git a/tests/Framework/Charset.php b/tests/Framework/Charset.php index f36b7b969..85cb4ba6c 100644 --- a/tests/Framework/Charset.php +++ b/tests/Framework/Charset.php @@ -71,6 +71,7 @@ class Framework_Charset extends PHPUnit_Framework_TestCase array('&BCAEMARBBEEESwQ7BDoEOA-', 'Рассылки', 'UTF7-IMAP', 'UTF-8'), array('Рассылки', '&BCAEMARBBEEESwQ7BDoEOA-', 'UTF-8', 'UTF7-IMAP'), array(base64_decode('GyRCLWo7M3l1OSk2SBsoQg=='), '㈱山﨑工業', 'ISO-2022-JP', 'UTF-8'), + array('㈱山﨑工業', base64_decode('GyRCLWo7M3l1OSk2SBsoQg=='), 'UTF-8', 'ISO-2022-JP'), ); }