cancel
Showing results for 
Search instead for 
Did you mean: 

File Encoding needed in adapter module

Former Member
0 Kudos

Dear all,

I have a Sender file adapter setup with a Seeburger PGP decryption module included.

I get a PGP encrypted file that is UTF-16LE encoded after decryption. When this payload is used for further processing errors occur while entering the message mapping. (caused by the fact that we did not translate UTF-16LE to UTF-8)

So to my opinion I need to convert the UTF-16LE to UTF-8, is that correct?

I tested with an unencrypted file (took the payload from the message above)  and a file adapter without the PGP module included. When I use "UTF-16LE" as "file encoding" and set the "file type" to "text" in the file adapter the payload gets processed well by the mapping!

So now the problem: I have to set the the file encoding to UTF-16LE to be able to process the message in the mapping. I need to do that in a adapter module after the PGP decryption takes place.

Can I add a "file encoding module" in the module chain after the PGP module?

What module can do that? Hope there is one.

regards,

Michel

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved.

Added self build adapter module to strip the BOM.

File is moved forward without a BOM towards message mapping.

In interface determination, java mapping I start reading input stream with UTF-16LE encoding.....converting the stream to XML message.

Not clear yet: adapter module should also translate to UTF-8 but that doesn't seem to work, although payload shows single byte it doesn't work when I omit the code to handle input stream as UTF-16LE in the java mapping.

Thanks Vadim for your quick responses!

vadimklimov
Active Contributor
0 Kudos

Hello Michel,

You can use the standard adapter module TextCodepageConversionBean to perform encoding/codepage conversion of the processed message payload by setting respective codepage name in the module parameter Conversion.charset. For more details regarding this module, please refer to the SAP Note 960663.

Regards,

Vadim

Former Member
0 Kudos

Hi Vadim,

Checked your suggestion but no conversion takes place.

Adapter is set to fiel type binary. Module is in place. Conversion.charset => UTF-16LE

Adapter log says:

MP: processing local module localejbs/AF_Modules/TextCodepageConversionBean

Conversion: ignoring non text payload

Any idea? Note this is a sender adapter, from SAP help I got the impression that this works fine outbound but does it also work inbound?

regards, and thanks for your quick reply.

vadimklimov
Active Contributor
0 Kudos

Hi Michel,

For transfers in binary mode, this module will not work - it was intended for text codepage conversions, so it will need text mode of data transfer in order to be operational.

Regards,

Vadim

Former Member
0 Kudos

Hi Vadim,

That won't work in my case because I receive a signed and encrypted file which needs to be processed by the Seeburger PGP module first. So cannot put it on text before PGP adapter module has processed the file.

So need a adapter module doing the same as putting the file type to text and putting the content type to UTF-16LE so it can be done after PGP module.

Regards,

Michel