ASCII TO EBCDIC: how ?

M

mike hengins

Hi,
I want to write the highest value of the EBCDIC data (xFF)
into an ASCII file in Java.

In other words,
I only to need to produce one value, and this value corresponds to the
highest value in EBCDIC.

Thanks for your help.
 
R

Roedy Green

Hi,
I want to write the highest value of the EBCDIC data (xFF)
into an ASCII file in Java.

In other words,
I only to need to produce one value, and this value corresponds to the
highest value in EBCDIC.

Thanks for your help.

If you mean that you are literally writing 7-bit ASCII, with 8-bit
chars, and you want this marker char, you want to set your file's
encoding to: "8859_1" see http://mindprod.com/jgloss/encoding.html
see http://mindprod.com/applets/fileio.html for sample code to write
to the file.

Now write char x = 0xff;

or char x = '\u00ff';

to the file.

If you want to generate true EBCDIC files, the EBCDIC encoding is not
directly supported, though four EBCDIC variants are under
a variety of names: Cp500, Cp1046, Cp1047, Cp1148.

Then I would do an experiment to see which unicode chars map to your
desired 0xff. Compose your file in Unicode, and trust the encoding
mechanism to create the equivalent EBCDIC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top