[comp.unix.questions] incompatibility in dd EBCDIC conversions?

idx009@cck.cov.ac.uk (the Crisco Kid) (12/05/90)

PROBLEM:

There appears to be an incompatibility in the conversion tables
used to map ASCII <-> EBCDIC in the UNIX dd utility, depending
on whether the UNIX on which dd is used is BSD-derived or SYSV-
derived.  This means that a file converted to EBCDIC with a Berkloid
dd is perverted when converted back to ASCII with an AT&T UNIX
dd, and vice-versa (Don't ask me why I wanted to do this!).


EVIDENCE:

A small C program to spit out all characters from octal 0 to octal
377 into a data file.  dd conv=ebcdic < data >ebcdic_data on both
machines.  od -c < ebcdic_data > map on both machines.  diff of the
two map files.  Lines flagged '<' are the BSD output, '>' the SYSV
output.  In this case, the Berkloid dd is on a Sequent Symmetry,
and the AT&Toid dd is on a Personal Iris.

3c3
< 0000040    @   O 177   {   [   l   P   }   M   ]   \   N   k   `   K   a
---
> 0000040    @   Z 177   {   [   l   P   }   M   ]   \   N   k   `   K   a
6c6
< 0000120  327 330 331 342 343 344 345 346 347 350 351   J 340   Z   _   m
---
> 0000120  327 330 331 342 343 344 345 346 347 350 351 255 340 275 232   m
8c8
< 0000160  227 230 231 242 243 244 245 246 247 250 251 300   j 320 241 007
---
> 0000160  227 230 231 242 243 244 245 246 247 250 251 300   O 320   _ 007
13,15c13,15
< 0000300    v   w   x 200 212 213 214 215 216 217 220 232 233 234 235 236
< 0000320  237 240 252 253 254 255 256 257 260 261 262 263 264 265 266 267
< 0000340  270 271 272 273 274 275 276 277 312 313 314 315 316 317 332 333
---
> 0000300    v   w   x 200 212 213 214 215 216 217 220   j 233 234 235 236
> 0000320  237 240 252 253 254   J 256 257 260 261 262 263 264 265 266 267
> 0000340  270 271 272 273 274 241 276 277 312 313 314 315 316 317 332 333


SYSTEMS TESTED:

4BSD: GNU dd, Sequent Symmetry
SYSV: IRIX 3.2, UNISOFT 5.1


QUESTION:

Why do SYSV-derived dd and BSD-derived dd differ?  Quoting the Sequent
manual page:

     The ASCII/EBCDIC conversion tables are taken from the 256
     character standard in the CACM Nov, 1968.

Our UNISOFT manual page says the same thing.  I don't have the CACM
issue, so I can't tell what's going on here, but somebody is wrong.
What's going on?


							Kay
-- 
There's a hole in my heart where the rain blows through...
Kay Dekker, Dept of Industrial Design, Coventry Poly, Coventry UK
37 Old Winnings Road, Keresley Village, Coventry
Phone: +44 203 838668 (work) +44 203 337865 (home)