OpenEdition character set experiment Rick Troth BMC ## ) Copyright 1996, Richard M. Troth, (see below). This is the README file for the OECS demo/experiment. The point is that a function can be written that automatically handles either an ASCII or an EBCDIC input stream (assuming the input is textual) and returns NULL-terminated strings of the correct local character set. Such a function can be used in shells, compilers, and any text processing components in a POSIX system like IBM's OpenEdition VM or OpenEdition MVS to facilitate interoperability with systems using the "foreign" base character set. Use of such a function for reading input streams is expected to reduce effort on the part of the customer, which will likely result in better sales of the system. Remember: interoperability is more important than compatibility. We lose the brass ring that OpenEdition offers if we don't surmount problems like this. ASCII toleration is only the first step. There's more work to do. VM, especially now with OpenEdition, provides an operating environment that is truly unique in the software industry. Let's keep going! After you've extracted oecs.tar (and converted all sources except oecstest.sh into EBCDIC if on OEVM), do a make and then oecat some_ASCII_file and/or oecat some_EBCDIC_file The output of either should be readable on your screen. Foreign shell scripts can often be executed with oecat some_script | sh (shell scripts that read from standard input excluded here) Like maybe oecat oecstest.sh | sh The 'oecat' program will automatically sense ASCII or EBCDIC input, convert lines as they are read, and write the native character set to its output stream, rendering foreign files readable and native files unharmed. Oecat is something that you might place in /usr/local/bin. The getline() function is where the real logic for this operation is found. Yes, I know that this getline() is horribly inefficient for a wide range of systems. But it compiles and runs as intended on a wide range of systems. Permission is granted to use the files found in this directory for experimentation, education, and inclusion in software for sale. The author, Richard M. Troth, and any employers, employees, associates, or relatives thereof, shall NOT BE HELD LIABLE for any damages resulting from the use or sale of this software. This software package is provided as-is in good faith for the common good and advancement of the art. The files in this package are README (this file), makefile, oecat.c, aecs.c, aecs.h, getline.c, putline.c, oecstest.sh Note that this last file, oecstest.sh, contains a mixture of ASCII and EBCDIC (thus "test" in its name). It should be left untranslated. The rest of the files are textual sources which should be translated into EBCDIC when ported to OpenVM. (in the general case, we don't expect to find source files with *both* ASCII and EBCDIC, but it makes a good test case) Updates can probably be found at http://casita.houston.tx.us/~troth/software/oecs.tar or at http://ua1vm.ua.edu/~troth/software/oecs.tar Many thanks to Dave Rivers at SAS for help in getting this to work. Thanks too to all the Workshop VMers who "hammered on it". -- Rick Troth <troth@casita.houston.tx.us>, Houston, Texas, USA http://casita.houston.tx.us/~troth/