cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding SAP output payload in AL32UTF8

Former Member
0 Kudos

Hello all,

I have a scenario where I want to encode the output XML from SAP PI in AL32UTF8 instead of UTF-8. Does anyone know how to do this? I cannot use the anonymizer bean as SAP does not recognize AL32UTF8 encoding. I tried changing it using XSLT but that doesnt work either for the same reason i guess.

Any clues anyone?

I realize UTF-8 should support AL32UTF8 encoding but the requirement here is quite specific as the target system adapter needs it with this specific encoding.

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you everyone for the responses.

Stefan,

Yes it is an oracle setting but there is a bug in the oracle version in use here where it rejects the payload if certain characters are present. This happens with UTF-8 encoding. I was checking if this bug can be bypassed using AL32UTF8. But looks like this is not possible. So I have put in a request for oracle version upgrade.

Thank you all for the time.

stefan_grube
Active Contributor
0 Kudos

AL32UTF8 is not a character set, it is a setting for Oracle database. So you do not change the encoding in the XML payload.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Rajith,

If XmlAnonymizerBean is not working, then I guess you have no choice but to use XSLT or Java Mapping.

http://scn.sap.com/docs/DOC-16138

Hope this helps,

Mark

Former Member
0 Kudos

Hello Mark,

Thanks for the reply. XSLT does not let me encode in AL32UTF8.

Using java mapping I tried using a string replace to remove UTF-8 and insert AL32UTF. But I think this corrupts the xml in some way as the target adapter is rejecting the files created this way.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You need to do byte conversion first then replace the encoding:

e.g

byte[] latin1 = srcXml.getBytes("ISO-8859-1");

byte[] utf8 = new String(latin1, "ISO-8859-1").getBytes("UTF-8");

String xml = new String(utf8, "UTF-8");

xml = xml.replaceAll("ISO-8859-1", "UTF-8");

Hope this helps,

Mark