Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting EBCDIC to ASCII

Status
Not open for further replies.

BRADENSTOKE

Programmer
Jan 2, 2003
24
GB
Does anyone know of a Component/Algorithm to convert ebcdic data to ascii using Delphi 4 Professional ?
I have sucessfully converted files from one AS400 using a simple if list, ie:
if Ch = 'â' then Ch := 'B'; etc.
This converts all the files from that server OK but only part converts files from another server.
I know ebcdic is 8 bit and ascii 7 bit and there are 4 tables and versions involved, it is a mystery to me.
Any help on how to start with ebcdic would be greatly appreciated.
 
You can find the necessary tables here:


(Look for &quot;EBCDIC <=> ASCII Translation Tables&quot; at the bottom of the page and take the link.)

Loop through the string and use each character as an offset into the appropriate table. Build up a result string by concatenating the converted characters as they are retrieved from the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top