need EBCDIC to ASCII function

Larry Jones scjones at sdrc.UUCP
Sun Oct 22 07:57:03 AEST 1989


In article <455 at laas.laas.fr>, news at laas.laas.fr (USENET News System) writes:
> How true, but aren't there still TWO official translations between
> ASCII and EBCDIC?  I believe that's one reason why uuencoded stuff
> sometimes breaks going through BITNET.  Or is the one cited above the
> one-and-only? 

Well, it depends on what you mean by "official".  The "official"
translation comes from an ANSI standard (X3.26 if memory serves)
for (of all things!) punched cards.  Since everyone agrees on how
to convert from holerith to ASCII and EBCDIC, transitivity gives
the "official" ASCII to EBCDIC translation.  This is also the
translation that is used when reading ANSI standard tapes on and
IBM mainframe (unless the local system programmers have been
mucking about).

Unfortunately, ASCII and EBCDIC don't always agree on the graphic
characters that are represented by the card punches.  As I recall,
the troublesome translations are:

		ASCII			EBCDIC
	---------------------	--------------------
	left brace		left brace
	right brace		right brace
	left bracket		cent sign
	right bracket		exclaimation point
	exclaimation point	solid vertical bar
	vertical bar		split vertical bar
	caret			logical not sign

Further complications are provided by the various printers and
terminals which have already been mentioned as printing various
apparently random bit patterns as desirable characters.  In an
attempt to rationalize the translation, people with good
intentions have developed any number of alternative translations.
The most common change is to map the ASCII exclaimation point and
vertical bar to the EBCDIC exclaimation point and solid vertical
bar (particularly if you're thinking about transferring text
files or program source that uses those characters) and/or
mapping the braces and brackets to the bit patterns which are
commonly used by printers.  Although it is an admirable goal to
get your text to print out correctly (or you program source to
compile!), it quickly leads to the current situation where there
are nearly an infinite number of conversions in common use.
----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at SDRC.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150-2789             AT&T: (513) 576-2070
"I have plenty of good sense.  I just choose to ignore it."
-Calvin



More information about the Comp.lang.c mailing list