Alaska Software Inc. - Convert ASCII to EBCDIC
Alaska Software Inc. - Convert ASCII to EBCDIC
Username: Password:
AuthorTopic: Convert ASCII to EBCDIC
Itai Ben-ArtziConvert ASCII to EBCDIC
on Tue, 29 May 2018 12:00:34 -0700
Hi,
I need to transmit a file (that also includes TIFF image) in EBCDIC.
Is there a function that converts ASCII to EBCDIC?
Is there a formula to convert ASCII to EBCDIC or should I use tables?
Many thanks,
-Itai
Andreas Gehrs-Pahl
Re: Convert ASCII to EBCDIC
on Wed, 30 May 2018 10:16:33 -0400
Itai,

>Is there a formula to convert ASCII to EBCDIC or should I use tables?

No, there is no (simple) formula to convert ASCII to EBCDIC. First, you need 
to determine which EBCDIC (and ASCII) Code Page(s) to use -- even if you 
only need to use "pure" 7-bit ASCII as your source. Then you need to use the 
appropriate lookup table to convert each byte separately.

>I need to transmit a file (that also includes TIFF image) in EBCDIC.

Based on what encoding for the transfer of the TIFF image is expected by the 
receiver -- Base64, BinHex, Uuencoded, Quoted-printable, etc. -- you might 
need to use the extended ASCII set (dec 0-255 / hex 00-FF), which makes it 
even more complicated and dependent on the specified code page(s).

For example, braces (or curly brackets) "{" and "}", the less-than "<" and 
greater-than ">", as well as the backslash "\", tilde "~" and circumflex "^" 
characters don't exist in "basic" EBCDIC, and are at completely different 
positions in various EBCDIC Code Pages. Also, many other punctuation marks 
are moved around a lot between Code Pages. So, determining and specifying 
the used EBCDIC Code Pages is essential when converting from (and to) ASCII!

For some examples and links to various EBCDIC code-page tables, see:
* https://en.wikipedia.org/wiki/EBCDIC_code_pages
* https://en.wikipedia.org/wiki/Binary-to-text_encoding

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC
Itai Ben-ArtziRe: Convert ASCII to EBCDIC
on Wed, 30 May 2018 14:04:06 -0700
Yes, it helps a lot!
Thank you, Andreas.
-Itai