Solved

ASCII to EBCDIC conversion and vice versa

Posted on 2002-07-02
4
696 Views
Last Modified: 2010-09-23
i'm currently developing a utility to convert ASCII to EBCDIC (to support translation of some bits in a legacy system). really stuck over here.

some sample codes are appreciated. hope someone here can guide me (either conceptually or otherwise).
0
Comment
Question by:emily_my
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 7125123
Conceptually, what you need to do is build a conversion table. For EBCDIC to ASCII, you would read a character in EBCDIC, find the ASCII equivalent in the table and write that out to a stream or file. The process would be reversed for ASCII to EBCDIC.
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 7125238
here is a link to a piece of code in C that might be useful to you.
http://www.room42.com/store/computer_center/c_translate.shtml
0
 
LVL 4

Accepted Solution

by:
pagladasu earned 50 total points
ID: 7125248
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7128699
pagladasu, that certainly is a start, but there are some problems: in descending order of importance:

1. If performance is an issue, e.g. in decoding long streams, constantly iterating the array like this is inefficient. In this respect, the C code is better.
2. The Java code uses proprietary code.
3. It doesn't translate both ways, as claimed

emily_my, you only need (maybe) to concern yourself with the first point.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question