?
Solved

ASCII to EBCDIC conversion and vice versa

Posted on 2002-07-02
4
Medium Priority
?
698 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 150 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses

718 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