Solved

ASCII to EBCDIC conversion and vice versa

Posted on 2002-07-02
4
695 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

739 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