How to change HEX value to EBCDIC char

What is the simplest way to convert HEX value to ebcdic char type in Java

eg. The example below will return to sign, but I would like to get the ebcidic equivalent, i.e. a space char ..

String hex = "40"; char c = (char) Integer.parseInt (hex, 16);

+2


a source to share


2 answers


The simplest and most efficient solution would probably be to write the lookup-table yourself, based on for example http://www.natural-innovations.com/computing/asciiebcdic.html .



More solutions can be found here .

+1


a source


Convert hex char in ebcdic (example: C1

)

byte b[] = {(byte) Integer.parseInt("C1", 16)};
System.out.print(new String(b, "Cp037"));

      



The result will be A

+1


a source







All Articles