cancel
Showing results for 
Search instead for 
Did you mean: 

Character Converting Problem at File Adapter

Former Member
0 Kudos

I am having a character conversion problem bringing in a XML file into XI.

It is converting the data wrong.

I have a file adapter picking up Audit.xml encoding is utf-8, use binary mode to pick it up.

XI takes the file and converts it into a text file.

I compared the hex of Audit.xml source file and the Audit.txt file and the characters are different for a specific few.

See attached image for details

Please let me know if any additional information will help

http://i9.photobucket.com/albums/a68/tkc204/SAP%20XI/Audit.png

Accepted Solutions (1)

Accepted Solutions (1)

sunilchandra007
Active Contributor
0 Kudos

Hi Chirag,

Try with File Type as Text at both sender and receiver file adapter.

Regards,

Sunil Chandra

Former Member
0 Kudos

Hi Sunil,

Thanks for the response.I have tried that. I still have the same problem I have tried the following

Text - UTF-8 to Text UTF-8

Binary to Text UTF-8

UTF-8 to Binary

sunilchandra007
Active Contributor
0 Kudos

Might be the specific character is not available in UTF-8. Try File Encoding with ISO-8859-1 or UTF-16 .

Regards,

Sunil Chandra

Former Member
0 Kudos

I will try that, but if the XML header has

<?xml version="1.0" encoding="UTF-8" ?>

doesnt it override your xi setting?

sunilchandra007
Active Contributor
Former Member
0 Kudos

Hey Thanks, Ive actually have reviewed those before. The file the source system is sending to xi is also not opening up in Internet Explorer.

The source system is 1252 and outputs xml to utf-8

I think there is an issue between those two.

But since the hex is changing in XI, the source system won't look at the data.

Former Member
0 Kudos

HI Chirag,

Please post the Audit.txt and Audit.xml data where you feel it's getting changed.So,that we can have a look and try to solve it.

Regards,

Nutan

former_member187339
Active Contributor
0 Kudos

Hi Chirag,

Try like this,

Keep the sender mode as binary

and receiver channel as TEXT with Windows-1252 encoding

Regards

Suraj

Former Member
0 Kudos

Appears that did the trick.

The data is appearing the same as the source. I need to do additional testting to verify that the issues is resolved.

Thanks

stefan_grube
Active Contributor
0 Kudos

> and receiver channel as TEXT with Windows-1252 encoding

First ask which codepage is expected by the receiver.

You cannot just put any codepage you like

Former Member
0 Kudos

The Source team claimed it was UTF-8. But after rigorous investigation it wasn't.

Answers (1)

Answers (1)

Former Member
0 Kudos

Then there is something wrong with the input XML document. It often happens that external applications send with declared XML header encoding UTF-8, but in reality it is ISO-8859-1. The ugly thing is, most of the time the problem will not be recognized, because most of the standard characters are encoded the same in UTF-8 and ISO-8859-1. But have a look at the ascii chars > 127, there you will see the problem.

You will note that problem if you just open the input file e.g. in Internet Explorer: if it displays some garbage for special characters or if it cannot open the file at all, then the sender uses the wrong encoding declaration.

So instead of tuning the XI parameters, better request the sender to send a correct XML

CSY

stefan_grube
Active Contributor
0 Kudos

> Then there is something wrong with the input XML document. It often happens that external applications send with declared XML header encoding UTF-8, but in reality it is ISO-8859-1.

You are right, that happens often. But here the input file is correct..

As you see in hex code, the characters are valid UTF-8 characters.

S.R.Suraj has already provided a solution for the issue, so I think this is solved.

Former Member
0 Kudos

Actually for this case Christian is right the source xml that I am receiving wasn't valid UTF-8. The program generating the xml was just putting the encoding - utf-8 tag on top because that's what the code told it to do.

The actual data is Windows-1252 in xml. So when XI reads it, it uses the utf-8 tag on top and is expecting UTF-8, but it was getting something else causing the unsupported characters to get converted.

The HEX was different on the Source XML comparing it to what XI was generating after File Adapter.

After making the output change to Windows 1252. It changes back to the expect HEX.

Source - is at Windows 1252

XI - it will use UTF-8 (no way to change it)

Target - forced to create in Windows 1252

Other helpful tools I used: W3C Validator - upload the file and found that I wasn't receiving UTF-8

I hope this is clear and helps someone else in the future.

Thanks For everyone's input.

Chirag