Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Problem with foreign characters in post by email
Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 9, 2013 - 3:49 am

I have activated the post by email plug-in on my forum http://www.brunnentreff.de/forum which runs in German and uses the German language files for the core, theme, plug-ins etc.

The post by email works well, except that it cannot handle the German character set.  We use the following characters: ä ö ü Ä Ö Ü ß

If I post an e-mail with these in from GMail, they get converted into =E4 =F6 =FC =C4 =D6 =DC =DF

Can a parse be added to the plug-in to convert them back again?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2013 - 2:12 am

Firstly my apologies for it taking so long to respond. You posted in the middle of a hosting move and for some reason it always takes longer for my dns changes to resolve so I only got full and stable access back this morning.

Would you be willing to send me an email using the same email client you used for the above and incorporating the same character set so that can scrutinise the raw message and see what it is we are missing?

If so then please send that to support at simple-press dot com and I will get into it. We clearly need to sort that.

Additional: Are you allowing attachments in your post by email posts? If not and you are willing to perform a few tests for me - and willing to make a small code change! - then let me know.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 10, 2013 - 8:02 am

I've just sent the e-mail with the characters in, just the same as I sent to the form except for the recipient.

I am allowing attachments, at least jpegs, which works very nicely and scales them to the max. size.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2013 - 10:51 am

Would you be willing to make a small code addition to test a possible fix?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 10, 2013 - 10:54 am

Sure, I'll do it overnight when the forum is quiet and backed up.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2013 - 11:15 am

That 's great - thanks.

OK - the file needed is in your forum-plugins folder /post-by-email/library/sp-email-post-imap.php

The function we need to make a change to is called sp_process_inbox_imap() but we actual;ly need to add a new line at about line 205. Look for this line of code:

if(empty($content) && $maybeNew) $content = $rawContent;

and on the line after that add:

$content = trim(utf8_encode(quoted_printable_decode($content)));

This change will pnly effect new email processing of course. It is also a test/temporary adjustment. If this works for you then we will get a proper fix in place for the next plugin update.

Thanks for the assistance.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 10, 2013 - 2:18 pm

I'm afraid it didn't work, the e-mail content got converted to this:

5CD2IPwgxCDWINwg3w0K

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2013 - 3:10 pm

Ha!
What is the charset of your WP site and - more importantly - your WP database please. That code fix assumed utf8...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 10, 2013 - 3:23 pm

Yellow Swordfish said
What is the charset of your WP site and - more importantly - your WP database please. That code fix assumed utf8...

Both are set to utf8, with the database collation set to utf8_general_ci.

 

The characters work fine in the other direction as well, ie. e-mail subscriptions to the topics.

Avatar
Graham Tappenden
Member
Free Members
sp_UserOfflineSmall Offline
May 10, 2013 - 3:26 pm

However something is strange about the fix.  The file only has 175 lines in it and the line to search for is at line 44, so nowhere near 205.

This is the version information in it:

/*
Simple:Press
Post by Email - Processing using IMAP
$LastChangedDate: 2012-04-24 15:14:20 +0100 (Tue, 24 Apr 2012) $
$Rev: 8448 $
*/

Is that the right file and the right version?

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17367
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626