I have an application that receives a parm in EBCDIC and I need to convert it to ascii. Anyone have an idea how this might be accomplished? Locked into Java 1.3
there is a free java utility with source to do the conversion. I haven't downloaded or tried it. The classic way to do these kind of conversions is to use an array of 256 bytes or chars, where for every EBCDIC code there is a correspondig ASCII code. So for example the char "1" is in EBCDIC code ="F1" (hex) and in ASCII code = "31" (hex).
At position "F1" (hex) = (15 * 16) + 1 = 241 in the array there will be "31" (hex).
But I think you can also solve this problem yourself with "OutputStreamWriter" where you can specify an encoding. (Although java.nio.charset.Charset is in from jdk1.4 you can still get it to work in without using it, I think)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.