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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 04:35 Go to next message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 11:39 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Sat Dec 16 21:08:52 EST 2017

Total time taken to generate the page: 0.00739 seconds