Supporting EBCIDIC Encoding in webMethods

Hello,

I have a requirement to support EBCDIC encoding. We receive a flat file and this needs to be encoded using EBCDIC before sending it to partner.

I have tried testing the same by passing a sample file to “pub.string.stringToBytes” service with CP037 in the encoding. I have then converted the output of this service to string format and sent it to business for conformation. They say that the file generated is ASCII and not EBCDIC encoded.

Any idea how i can achieve the EBCDIC encoding for the files in webMethods.

Thanks.

Hi Arun,
I have tried this and it works as expected - Can you please try this
Step 1: Invoke pub.string:stringToBytes with inputs , string - test, encoding - CP037
Output is a byte[ ]
Step 2 :Invoke pub.string:bytesToString with inputs , bytes - output byte[ ] of previous execution, encoding- CP037
If the output of this execution is the same string as the input string , then it is working correctly.

Note: you can try changing the encoding input in Step 2 to ASCII, and you should see a different result compared to the input.

Regards,
-Nagendra

Hi Arun,

Yes, the pub.string.bytesToString with your code page as the encoding (ie CP037 in the US with OS390) for EBCDIC to ASCCI andYes, the pub.string.bytesToString with your code page as the encoding (ie CP037 in the US with OS390) for EBCDIC to ASCCI and
pub.string.stringToBytes with the code page as the encoding for ASCII (really unicode) to EBCDIC.
pub.string.stringToBytes with the code page as the encoding for ASCII (really unicode) to EBCDIC.

====
Also you can browse this pretty old thread:

HTH,
RMG

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.