cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding issue in PI

former_member460664
Participant
0 Kudos


Hi All,

I have been facing encoding issue for last couple days. Some times I am getting correct output files. Some times not getting. My requirement is If input file has special characters ( example, Spanish characters) then output should be generated in ANSI. If does not have special characters it should be UTF-8. I have received two input files, both have special characters(Spanish characters). One file is generated in ANSI and another file is generated in UTF-8 Mode. I have checked data in both inputs file. special characters are similar in both the input files. My scenario is JMS to JMS. Not able to understand where the problem was exactly?

Thanks in advance.

Best Regards,

Ashok.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Try to use ISO-8859-1 or ISO-8859-2 (same as CP-1252)

Regards,

Hiren

RaghuVamseedhar
Active Contributor
0 Kudos

Ashok,

My understand of issue: - UFT-8 JMS to JMS sometimes work. Good.

But sometimes it fails. Where does it fail?

If messages fail in graphical mapping, read my blog. Post the input file screenshot in notepad++.

FYI... UFT-8 can encode all know characters (some 1,114,112). ASCII can encode 256 characters.

Always try to use UTF-8. There are no "special characters". Spanish character are like any-other characters.

Open the files with Notepad++ or some good editor which first decodes characters in UFT-8 like foxe (and fallback on some other encoding).

xavisanse
Active Participant
0 Kudos

try to use ISO-8859-1

stefan_grube
Active Contributor
0 Kudos

Set CCSID 1252 in sender and receiver channel. UTF-8 and cp1252 is identical, when there is no special character.

What parameters do you use for MessageTransformBean? Do you use Transform.ContentType?

former_member460664
Participant
0 Kudos

Hi Stepan,

2 input files have special characters. I have not used CCSID in sender channel. Even though I am getting correct output file for first input file.

Yes, I have used Transform.ContentType parameter and value is text/plain;charset=utf-8. I have used MessageTransformBean in both sender and receiver JMS channels..

Regards,

Ashok.

former_member460664
Participant
0 Kudos

Hi Stefan,

As you said, I have maintained 1252 in sender channel also. Result is same for this setting also. One file is generated in ANSI and second file is generated in UTF-8. Dont understand where the problem was. Kindly give your inputs to solve this issue....

Regards,

Ashok.

stefan_grube
Active Contributor
0 Kudos

Check the files with a  hex editor. Compare the hex codes of the special characters in the files with a code page chart.

former_member460664
Participant
0 Kudos

Hi Stefan,

Thanks for your quick response. If I split the failed file (big in size) into smaller files and processed the smaller files then smaller files are generating in required format i.e, files which  have special characters are generating in ANSI, files which dont have special characters are generating in UTF-8. Unable to understand why is it so?

Regards,

Ashok.

stefan_grube
Active Contributor
0 Kudos

All files are ansi. When you have no special characters, then ansi and UTF-8 are identical. So the file is as well UTF-8 and ANSI.

You do not have any issue at all.

Harish
Active Contributor
0 Kudos

Hi Ashok,

Please provide the the sample data, channel configuration and more details about the issue.

Please refer the below blog and document

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79f...

regards,

Harish

former_member460664
Participant
0 Kudos

Hi Mistri,

Thank you for your quick response.

sample data is like.. ESPAÑA S.L.

CCSID for non-ASCII Names is.. 1252

Module Sequence in PI is...

1) localejbs/AF_Modules/MessageTransformBean

2)SAP XI JMS Adapter/ConvertMessageToBinary

3)AF_Modules/DynamicConfigurationBean

4)SAP XI JMS Adapter/SendBinarytoXIJMSService

Regards,

Ashok.

Harish
Active Contributor
0 Kudos

Hi Ashok,

you can try with JMS.TextMessage.charset.

Reference https://help.sap.com/saphelp_nw74/helpdata/en/0a/2e368bd3c443349f90f10195709114/content.htm



regards,

Harish