Migrating Java application from HP/UX to Linux - String to byte array issues
I have a Java application which is currently running on an HP/UX box and is being migrated to Suse Linux. The application must translate data from ASCII to EBCDIC to send to a mainframe legacy app. If I have the code line below in in HP/UX, it works fine:
String transactionName = new String(transNameByteArray); However, executing this same code in Linux produces a String which is neither ASCII nor EBCDIC valid data. I understand that I may need to force the code page used as it may be different on HP/UX than on Linux but I am not sure what the code page would be. The line below doesn't correct the issue: String transactionName = new String(transNameByteArray, "ISO-8859-1"); |
Quote:
ASCII <-> EBCDIC conversion (I used IBM500 because the EBCDIC Wikipedia page uses it in the example): Code:
import java.math.*; Code:
% java Ascii2Ebcdic | od -t x1 |
All times are GMT -5. The time now is 09:07 AM. |