FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Mini-patch to better deal with mailing-list subject lines
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Mini-patch to better deal with mailing-list subject lines [message #163913] Sat, 11 December 2010 09:35 Go to next message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma: 0
Junior Member
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.
Re: Mini-patch to better deal with mailing-list subject lines [message #163916 is a reply to message #163913] Sat, 11 December 2010 16:39 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Good idea, but maybe we should rather do a mb_internal_encoding('UTF-8'); (use the default theme's charset).
Let me think about it for a while.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Useful function when there are still some ISO-8859 chars in the UTF8 database stored messages
Next Topic: Suggestion for the "rebuild search index" page
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 17:36:20 GMT 2024

Total time taken to generate the page: 0.02459 seconds