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.
pull/7091/head
Hiroshi Shirosaki 6 years ago
parent e3c6989494
commit 869d1d1eaf

@ -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

@ -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'),
);
}

Loading…
Cancel
Save