$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: true, vro: true, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

Special Characters in Mail Subject line

Hi all,

We are using the Mail Adapter to retrieve emails from an Exchange server.

In one of our tests we sent an email with the following subject:

Special Characters Test 123!"£$%^&*():@~{}[]/.,<>

However the text we received in PI was actually:

Special_Characters_Test_123!"£=?iso-8859-1?Q?=24=25=5E=26=2A=28=29=3A=40=7E=7B=7D=5B=5D=5C/=2E=2C=3C=3E?=

We have also tested each character individually and it appears that only certain sequences are causing this issue.

I suspect that this has something to do with the different character sets used by Exchange server (iso-8859-1) and PI (UTF-8).

Could anyone indicate how we could decode these characters back to normal text in our message mapping? or in any way resolve our problem?

Many thanks,

Aldo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Nov 21, 2010 at 11:56 PM

    A simple question and a lot of wrong answers.

    Better you look in Wikipedia 😉

    A mail subject will always represented by a string like this, when it includes non-ascii signs.

    This is email standard. There is nothing you can do to prevent this.

    The subject has an identifier =? then the codepage , then the type of encoding Q = quoted-printable, then the encoded subject followed by an identifier ?=

    The easiest solution for this issue: Only allow ASCII characters in email subject.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 17, 2010 at 01:15 PM

    Hi,

    This doc will help you to handle encoding for Mail adapter :

    [HOW TO WORK WITH CHARACTER ENCODINGS IN PI|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]

    Regards

    Ashutosh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 17, 2010 at 12:13 PM

    Hi Aldo,

    It looks even an empty space it is taking as '_'. You can change Exchange Server encoding to 'UTF-8' or else change the PI encoding while editing the parameter to required encoding in Visual Administrator (If you are adminstrating PI using VA).

    If at all you want to handle this in mapping you can write a simple script and map the subject field to field.

    Regards

    Pothana

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 17, 2010 at 12:13 PM

    Try setting the content encoding parameter in sender mail adapter to base 64

    http://help.sap.com/saphelp_nw70/Helpdata/en/23/c093409c663228e10000000a1550b0/content.htm

    regards

    Ninad

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 17, 2010 at 01:57 PM

    Hi Pothana,

    I did try to change the encoding of the Exchange server to UTF-8, but there was no difference in the result.

    Note that this problem is only in the subject line. If I send the same text in the content it is received correctly.

    (Changing the encoding of PI is not an option... I do not have access to the Visual Administrator).

    @Ninad since I am taking the Subject from the ASMA (as suggested by SAP) I don't think that changing the content encoding of the message would make a difference.

    @Ashutosh I do have that document but I can't find anything that can help me in there. Do you see anything that could help resolve this specific issu?

    In the mean time the problem is still there...

    Thanks for any additional help you can give me,

    Aldo

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Francesco,

      I think that these adapter modules work only on the payload of the message. Not on the adapter attributes (ASMA) from which I am taking the Subject line. (but please correct me if I am wrong).

      I am thinking to write a Java user defined function to resolve the problem (not a bespoke Java adapter module) but I am not sure on how to tackle this. How would I translate that text back to normal? or how would you do it?

      Many thanks,

      Aldo