Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: need EBCDIC to ASCII function Message-ID: <918@sdrc.UUCP> Date: 21 Oct 89 21:57:03 GMT References: <1060@einstein.misemi> <7214@cognos.UUCP> <455@laas.laas.fr> Organization: SDRC, Cincinnati Lines: 50 In article <455@laas.laas.fr>, news@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@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