TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jasen Betts
from: Neil Heller
date: 2003-03-27 08:31:00
subject: portability

NH> It just dawned on me (after reading Mr. McBrine's post) that if
NH> one were to use only decimal numerics and English alphas
NH> converting from ASCII to EBCIDIC or vice versa would be really
NH> quick (as in table driven, no decisions).

JB> yeah,  something like

JB>   *(char_pointeer++) = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[digit]

That's interesting.  Would you please write a snippet in which you would 
use the above pointer to convert ASCII to EBCDIC, or vice versa?

What I had imagined doing was setting up a 16x16 matrix and then using 
the source character value as an offset into that table.

JB> would compile and work fine on both EBCDIC and ASCII/UTF systems.
JB> also it could possibly be extended for base64 encoding etc...

Are you talking about conversion to/from unicode here?

þ CMPQwk 1.42 999

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.