home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / programm / 3308 next >
Encoding:
Text File  |  1992-12-11  |  1.6 KB  |  39 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!gossip.pyramid.com!decwrl!amdcad!angelo!roberts
  3. From: roberts@angelo.amd.com (Dave Roberts)
  4. Subject: Re: Binary to ASCII encodings (was Re: A better mousetrap)
  5. Message-ID: <1992Dec11.201318.28429@amd.com>
  6. Sender: usenet@amd.com (NetNews)
  7. Nntp-Posting-Host: angelo
  8. Organization: Advanced Micro Devices, Santa Clara, CA
  9. References: <18287@mindlink.bc.ca> <1992Dec9.132902.7930@unipalm.co.uk>
  10. Date: Fri, 11 Dec 1992 20:13:18 GMT
  11. Lines: 26
  12.  
  13. In article <1992Dec9.132902.7930@unipalm.co.uk> tim@unipalm.co.uk (Tim Goodwin) writes:
  14.  
  15. >uuencode uses a fixed 3-byte -> 4-character encoding, for a 1.333
  16. >swell factor.  (There is also some additional overhead, for example the
  17. >line feed at the end of each line, and the "M" at the beginning of
  18. >each.)
  19.  
  20. Just a quibble.  The "M" at the beginning of the line isn't an "M" per
  21. say.  It's actually a length of the number of character in the line
  22. that has been encoded in the same fashion as the six bits of normal
  23. data are.  It so happens, however that most (all?) of the programs
  24. that do uuencoding use the same line length.  If you look at the last
  25. line of the encoded file, however, (the one before the "end" line)
  26. you'll see that it probably isn't as long as the others and doesn't
  27. have an "M", but rather something else as the first character.
  28.  
  29. In other words, if you're writing a decoder, don't look at the first
  30. character of a line as an "M", look at it as a length.  It makes
  31. everything general, and if anybody writes an encoder that uses a line
  32. length different than "M" (which I suppose is legal), yours won't be
  33. the decoder that breaks.
  34.  
  35. Dave Roberts
  36. david.roberts@amd.com
  37.  
  38.  
  39.