This helps with mail imports with encoded subject lines when iconv.internal_encoding is not UTF-8.
I tested this locally : I was getting an error on database insert before, the mail imports fine with the patch (phpinfo shows iconv.internal_encoding being iso8859-1 on the server).
--- scripts_common.old 2010-12-11 13:59:23.000000000 +0100
+++ scripts_common.inc 2010-12-11 13:59:07.000000000 +0100
@@ -140,7 +140,7 @@
// Better to let PHP do it as it will also deal with non-UTF-8 characters.
if (function_exists('iconv_mime_decode')) {
- return iconv_mime_decode(trim($val), 2);
+ return iconv_mime_decode(trim($val), 2, "UTF-8");
}
// Decode string.