In our daily business we have to handle different types of data-sources and data-sinks. Most of these data-source and data-sinks are UTF-8 aware already. But what if one of these is does not provide data in UTF-8 or does not understand it at all?
The PI/PO is only handling UTF-8-Data so how is it possible within the PI to convert the Encoding of a File/Message?
In one of our current scenarios we have to handle fixed-length files, which are read from a SFTP server.
(But this guide should also be valid for other scenarios)
The configuration is simple, but not obvious since the behaviour of the MessageTransformBean is a little bit strange :wink:
Here is what you have to do in the Module-Chain of your channel if you want to convert a message from a supported encoding into UTF-8.
Processing Sequence
Module Configuration
The key in this configuration is to use two different instance of the MessageTransformBean. The first one only sets the codepage, and mime-type, which is then converted by the TextCodepageConversionBean. The sencond one parses the (now utf-8) text into xml.
These two steps are necessary since the class "com.sap.aii.messaging.adapter.Conversion" expects its data as utf-8 which is not right if the incomming codepage is not utf-8 but an other one.