MIME UTF-8 Subject Encoding

General discussion about Custom Buttons, including feature requests.

MIME UTF-8 Subject Encoding

Postby mandriospo » Tue Mar 07, 2017 8:36 am

How can I decode subject of selected e-mail using custom buttons?
This is my code sample:
Code: Select all
var msgHdr = gFolderDisplay.selectedMessage;
var subject = msgHdr.getStringProperty("subject");
alert(subject);


alert function gives output like this:
=?UTF-8?Q?Kupuj=C4=85cy_Client:123_zg=C5=82osi=C5=82_pro?= =?UTF-8?Q?blem?=

when in fact it suppose to look this way:
Kupujący Client:123 zgłosił problem


any idea?
mandriospo
 
Posts: 25
Joined: Mon Apr 04, 2016 10:13 am

Re: MIME UTF-8 Subject Encoding

Postby morat » Tue Mar 07, 2017 2:11 pm

Try this:

Code: Select all
var msgHdr = gFolderDisplay.selectedMessage;
var subject = msgHdr.mime2DecodedSubject;
alert(subject);
morat
 
Posts: 959
Joined: Wed Dec 28, 2011 2:38 pm

Re: MIME UTF-8 Subject Encoding

Postby mandriospo » Wed Mar 08, 2017 7:39 pm

Excellent!
mandriospo
 
Posts: 25
Joined: Mon Apr 04, 2016 10:13 am


Return to General Discussion

cron