ASCII TO EBCDIC: how ?

Discussion in 'Java' started by mike hengins, Aug 29, 2005.

  1. mike hengins

    mike hengins Guest

    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.
    mike hengins, Aug 29, 2005
    #1
    1. Advertising

  2. mike hengins

    Roedy Green Guest

    On Mon, 29 Aug 2005 23:46:41 +0200, "mike hengins" <> wrote
    or quoted :

    > 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.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
    Roedy Green, Aug 30, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sylvain

    EBCDIC ascii conversion?

    Sylvain, Jun 13, 2004, in forum: Java
    Replies:
    2
    Views:
    21,762
    Thomas Weidenfeller
    Jun 14, 2004
  2. Replies:
    9
    Views:
    6,899
  3. Re: detecting ASCII/EBCDIC

    , Sep 2, 2008, in forum: C Programming
    Replies:
    3
    Views:
    377
  4. Antoninus Twink

    Re: detecting ASCII/EBCDIC

    Antoninus Twink, Sep 2, 2008, in forum: C Programming
    Replies:
    2
    Views:
    323
    Richard
    Sep 3, 2008
  5. Keith Thompson

    Re: detecting ASCII/EBCDIC

    Keith Thompson, Sep 3, 2008, in forum: C Programming
    Replies:
    2
    Views:
    316
    Keith Thompson
    Sep 3, 2008
Loading...

Share This Page