C/C++ : Ascii to EBCDIC Converter

Continue from my last post about Convert EBCDIC to Ascii Convert, now I try to create a program with C/C++ to convert Ascii to EBCDIC (ascii to ebcdic converter). Create a file main.c and copy this code :

We can compile this code Ascii to EBCDIC Converter with command :

gcc main.c -o ascii2ebcdic

This is output program for Ascii to EBCDIC Converter :

You can read about convert ebcdic to ascii at here.

C/C++ : EBCDIC to Ascii Converter

ASCII is the American Standard Code for Information Interchange, also known as ANSI X3.4. There are many variants of this standard, typically to allow different code pages for language encoding, but they all basically follow the same format. ASCII is quite elegant in the way it represents characters, and it is very easy to write code to manipulate upper/lowercase and check for valid data ranges.
ASCII is essentially a 7-bit code which allows the 8th most significant bit (MSB) to be used for error checking, however most modern computer systems tend to use ASCII values of 128 and above for extended character sets.

EBCDIC (Extended Binary Coded Decimal Interchange Code) is a character encoding set used by IBM mainframes. Unlike virtually every computer system in the world which uses a variant of ASCII, IBM mainframes and midrange systems such as the AS/400 tend to use a wholly incompatible character set primarily designed for ease of use on punched cards. EBCDIC uses the full 8 bits available to it, so parity checking cannot be used on an 8 bit system. Also, EBCDIC has a wider range of control characters than ASCII.

I try to create C/C++ code EBCDIC to Ascii Converter. Save this code with name main.c

We can compile this code EBCDIC to Ascii Converter with command :

gcc main.c -o ebc2ascii

This is output program for EBCDIC to Ascii Converter :

You can read about how to convert Ascii to EBCDIC in here.

Source :

http://www.dynamoo.com/technical/ascii-ebcdic.htm