home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / filutl / toadxx11.arc / XXENDEC.DOC < prev   
Text File  |  1989-09-16  |  3KB  |  63 lines

  1. Date: Wed, 13 Jul 88 13:39:20 cdt
  2. From: wucs1!wubios!david@uunet.UU.NET (David Camp)
  3. Subject: XXENCODE.C and XXDECODE.C
  4.  
  5.      Here is the source for XXENCODE and XXDECODE, replacements for
  6. UUENCODE and UUDECODE that use a better character set.  I use them to
  7. transfer files between VM/CMS and my PC and Unix.  They were developed by
  8. Phil Howard <PHIL@UIUCVMD.BITNET>.  I adapted them for MS-Dos and VM/CMS.
  9. They are public domain.
  10.  
  11. Notice that under VM/CMS, these require the Waterloo C compiler.  Under
  12. MS-Dos they require the Microsoft C compiler.  The usual cc command works
  13. under Ultrix.
  14.  
  15. *-------------------------------------------------------------------------*
  16. | (314) 362-3635             Mr. David J. Camp              |
  17. | Room 1108D           ^         Box 8067, Biostatistics          |
  18. | 706 South Euclid     < * >       Washington University Medical School |
  19. |               v         660 South Euclid              |
  20. | Bitnet: david%wubios@wucfua.wustl  Saint Louis, MO 63110          |
  21. | Internet: david%wubios@wucfua.wustl.edu                  |
  22. *-------------------------------------------------------------------------*
  23.  
  24. -----xxencode.doc-----
  25.  
  26. Date:          Thu, 9 Jun 88 14:51:50 CDT
  27. Reply-To:     "Mark S. Zinzow" <MARKZ@UIUCVMD>
  28.  
  29. Here is some further information on UUENCODE and XXENCODE.
  30.  
  31. UUENCODE has both a header to begin a file and identify it's name, and for
  32. UNIX systems (where UUENCODE was designed) to carry the file protection
  33. bits.  It also has a trailer to terminate the file decoding so that the
  34. entire coding is bounded from any garbage added by mailers, sign, etc.
  35.  
  36. UUENCODE uses a set of 64 different non-blank characters to represent each
  37. 6 bits.  Three binary bytes in sequence is represented by four output
  38. characters.  The first character on a line is the number of binary bytes
  39. the rest of that line represents.  Each line encodes up to 45 bytes in up
  40. to 60 characters.  Any incomplete set of 3 bytes is encoded as 4
  41. characters and the group length truncates the output.
  42.  
  43. XXENCODE retains all these characteristics, good or bad.  They are not
  44. ideal but they are proven to work.  It's not the most efficient, but it is
  45. very close to the optimal balance.
  46.  
  47. Unlike XXENCODE, UUENCODE uses characters where the 6 bits that they
  48. represent form the original binary are the same as the lower 6 bits in the
  49. ASCII code of that character.  A straight port of the C source to any
  50. other character set will simply not work at all.  Drastic modification can
  51. get it to work, but the problem of incosistent translations seriously
  52. complicates such modified versions.
  53.  
  54. XXENCODE simply uses the 26 UPPER case letters, 26 lower case letters, the
  55. 10 digits, and the characters "+" (plus) and "-" (minus).  An assigned
  56. relationship is mapped in the character table in the source code.
  57.  
  58. By the way, older versions of UUENCODE coded bits 000000 as a blank.  The
  59. newer version specially changes that to a different character that also
  60. has 000000 as it's lower 6 bits to it is actually compatible forward and
  61. backwards unless the file goes through a mailer that plays with tab
  62. changes or squishes white space.  XXENCODE does not encode any blanks.
  63.