Path: utzoo!attcan!uunet!wuarchive!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!adw From: adw@otter.hpl.hp.com (Dave Wells) Newsgroups: comp.lang.c Subject: Re: EBCDIC <--> ASCII conversion Message-ID: <28020001@otter.hpl.hp.com> Date: 16 Oct 90 08:57:19 GMT References: <1756@dinl.mmc.UUCP> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 30 Charles Noren at Martin Marietta I&CS, Denver CO: >We are communicating between Sun 3 (with SunOS 4.0.3) and an >IBM Mainframe (don't know the model, we're not IBM jocks) >via TCP/IP. Our question, is there any program in Netland >that converts back and forth between EBCDIC and ASCII >(preferrably in C, but we will take any example)? Jonathan I. Kamens at Massachusetts Institute of Technology: | The Unix program "dd" does this. In particular, the "conv=ascii" option |converts EBCDIC to ASCII, and the "conv=ebcdic" option goes the other way. | See the man page for more information. It's particularly worth noting this (from that dd man page): ASCII and EBCDIC conversion tables are taken from the 256- character ACM standard, Nov, 1968. The ibm conversion, while less widely accepted as a standard, corresponds better to certain IBM print train conventions. There is no ^^^^^^^^^^^ universal solution. ^^^^^^^^^^^^^^^^^^^ If you're translating "ordinary text files", dd will probably do the trick. If you're hoping to translate files or streams containing "unusual" characters (e.g. control codes for a graphics terminal), the exact translation table may well vary on a per-site basis. Dave Wells