cancel
Showing results for 
Search instead for 
Did you mean: 

Special Characters in Mail Subject line

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Stefan, thanks for your reply.

I think that this explains the problem however I am still surprised that we have this limitation for the subject line.

I have carried out a test and if I take out the only non-ascii character (£) from the above subject line, the content is received correctly.

Said that, I don't think I will be able to force users not to enter non-ascii characters in the subject line. Therefore we will have to keep this problem... and get on with it.

Thanks for your help. I am giving you full marks and closing this thread.

Best.

Aldo

stefan_grube
Active Contributor
0 Kudos

I have found SAP Note 1494700 for this issue.

Former Member
0 Kudos

Thanks Stefan! This should exactly solve the issue. We will apply the note. Best. Aldo

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

Ciao Aldo

did you try to manipulate the codepage of the payload with Standard Adapter Module: [TextCodepageConversionBean|http://help.sap.com/saphelp_nwpi711/helpdata/en/45/da2deb47812e98e10000000a155369/content.htm]

or

[MessageTransformBean|http://help.sap.com/saphelp_nwpi711/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm]

If this will not work I suggest to write a specific java Module to fix the problem.

Francesco

Former Member
0 Kudos

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

former_member192079
Participant
0 Kudos

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

former_member207622
Contributor
0 Kudos

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

former_member472138
Active Contributor
0 Kudos

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