SOS: C Routines for ASCII to EBCDIC Conversion and Vice-versa
Daniel A. Graifer
dag at fciva.FRANKCAP.COM
Sat Jun 22 05:19:11 AEST 1991
In article <1991Jun20.115613.13073 at mp.cs.niu.edu> rickert at mp.cs.niu.edu (Neil Rickert) writes:
>In article <1991Jun19.190752.28034 at ssdc.honeywell.com> satya at ssdc.honeywell.com (Satya Prabhakar) writes:
>>uses EBCDIC. I am looking for C routines that convert ASCII strings
>>into EBCDIC strings and vice-versa. We need these DESPERATELY and
>
> I don't understand. What is wrong with a simple loop replacing
>c with EBCDIC[c] for each char c in the string of unsigned chars.
>Something like:
> while(*p) { *p = EBCDIC[*p]; p++;}
>
> You do need to initialize your table. Pick up the tables used on the
>3090 and use those. If you don't like that choice build your own in
>the grand tradition of mutual inconsistency which currently exists in
>the ASCII <-> EBCDIC translation world.
I wrote a two line c program to output chars0-256, and
piped this through dd -ascii and od -c to create my
table. This way, the table is at least consistant with
what dd produces. Note that the table produced this way
will not necessarily be invertable. (But then neither
are the mainframe translate tables. If I recall my
Burroughs B[67]000 days correctly (now Unisys A-Series),
the translation of ASCII "!" was not invertable. And
you may have a real problem with the >100 EBCDIC chars
that aren't meaningful.
Dan
--
Daniel A. Graifer Coastal Capital Funding Corp.
Sr. Vice President, Financial Systems 7900 Westpark Dr. Suite A-130
(703)821-3244 McLean, VA 22102
uunet!fciva!dag fciva.FRANKCAP.COM!dag at uunet.uu.net
More information about the Comp.unix.questions
mailing list