About 10 years ago I was receiving mainframe EBCDIC files to our Windows servers and converting them to ASCII with the simple script below. It was handy since it could be customized to any non-standard character set desired:

# e2a - convert an EBCDIC file to ASCII. @E2A = qw( 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D F8 2F F8 F8 32 33 34 35 36 37 38 39 3A 3B 3C 3D F8 3F 20 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 3C 28 2B 7C 26 F8 F8 F8 F8 F8 F8 F8 F8 F8 21 24 2A 29 3B 5E 2D 2F F8 F8 F8 F8 F8 F8 F8 F8 7C 2C 25 5F 3E 3F F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 3A 23 40 27 3D 22 F8 61 62 63 64 65 66 67 68 69 F8 F8 F8 F8 F8 F8 F8 6A 6B 6C 6D 6E 6F 70 71 72 F8 F8 F8 F8 F8 F8 F8 7E 73 74 75 76 77 78 79 7A F8 F8 F8 5B F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 F8 5D F8 F8 7B 41 42 43 44 45 46 47 48 49 F8 F8 F8 F8 F8 F8 7D 4A 4B 4C 4D 4E 4F 50 51 52 F8 F8 F8 F8 F8 F8 5C F8 53 54 55 56 57 58 59 5A F8 F8 F8 F8 F8 F8 30 31 32 33 34 35 36 37 38 39 F8 F8 F8 F8 F8 F8 ) ; open (FILE, $ARGV[0]) or die "Can't read $ARGV[0]: $! "; while (<FILE>) { s/(.)/chr(hex($E2A[ord($1)]))/eg; print; }

In reply to Re: Converting Mainframe EBCDIC data by JohnYEC
in thread Converting Mainframe EBCDIC data by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.