lotus



previous page: 06  What is encoding? (File Formats and Conversion - Macintosh)
  
page up: Telecommunications on Macintosh FAQ
  
next page: 08  a) What are AppleSingle and AppleDouble? b) What is MacBinary? (File Formats and Conversion - Macintosh)

07 (a) What is BinHex? (b) What is uuencode? (c) What is Base64 ? (File Formats and Conversion - Macintosh)




Description

This article is from the Mac communications FAQ, by Bruce L Grubb BruceG6069@aol.com with numerous contributions by others.

07 (a) What is BinHex? (b) What is uuencode? (c) What is Base64 ? (File Formats and Conversion - Macintosh)

These are all ASCII encoding (see [2.2]) formats.

(a) BinHex 4.0, by Yves Lempereur, is a binary to text translator
that can directly encode any Macintosh document (ie: it knows how to
convert information in both the resource and data forks). Since the
format is mainly used on already compressed files the RLE compression
method that can be part of the format is rarely used.
BinHex files can be easily recognized since they begin with the line:

(This file must be converted with BinHex 4.0)

and are followed by a line starting with a colon, ':'. The BinHex
encoding of the file follows, and is ended with another colon.
Binhex 4.0 files also can be identified externally by the suffix ".hqx".

The best option to handle BinHex 4.0 is to use a utility
like StuffIt Expander and other StuffIt programs, and SunTar
to name only a few. StuffIt Expander has the advantage of also
being able to automatically expand StuffIt, Compact Pro, and
Applelink archives and being available on PCs.

The specifications to BinHex, should you be an interested programmer,
are available at the University of Michigan's Macintosh archive site
as mac/misc/documentation/binhex4.0specs.txt, or at InfoMac sites as
dev/info/binhex-40-specs.txt.

There is also a program/format called "BinHex 5.0"; but it is NOT a
more advanced version of "BinHex 4.0" but rather a separate _binary_
encoding format (see [2.2]). BinHex 5.0, written by Yves Lempereur,
in 1985 was the first MacBinary converter available. BinHex 5.0 (also
called MacBinary I) was replaced by the MacBinary II format which
added support for several then new MacOS features (see [2.4b]).

As new versions of BinHex were developed, they encoded only the
new format but continued to decode all previous formats:

BinHex 1.0 encodes .hex and decodes .hex
BinHex 2.0 encodes .hex & .hcx and decodes .hex & .hcx
BinHex 3.0 never existed
BinHex 4.0 encodes .hqx and decodes .hex, .hcx & .hqx
BinHex 5.0 encodes MacBinary I and decodes .hex, .hcx,
.hqx & MacBinary I

(b) "uuencode" is a binary to text translator that serves the same
purpose as BinHex, except that it knows nothing about the Macintosh
resource/data fork structure. Uuencode was designed to allow UNIX
binary files to be easily transferred through text-only interfaces,
such as e-mail. Every uuencoded file contains a line similar to:

begin 644 usa-map.gif

followed by a series of lines of ASCII text characters (which are
normally 60 characters long and begin with the letter 'M').
The file ends with a line containing the word 'end'. There may be
other special keywords included. Externally uuencode files are
usially denoted with the suffix ".uu" or ".uue".

Usually, one won't find Macintosh files in uuencode format; however,
most non-Macintosh specific binary data posted to Usenet is
uuencoded, so if you wish to use any of this data (such as the images
posted in alt.binaries.* and elsewhere), you will need to deal with
uuencode. The programs 'uuencode' and 'uudecode' exist on most UNIX
systems. If not, don't worry as there are many programs allow you to
convert to and from uuencode using your Macintosh (see [2.6]).

(c) Base64 is the encoding format used by Multipurpose Internet Mail
Extension (Mime) files. The reason mime uses Base64 rather than the
more popular uuencode format is that uuencode is not really a standard
but rather a collection of related but different formats. This rendered
uuencode impractical as a cross platform encoding format.

Mac files being sent via e-mail are usially binary encoded (usially
in AppleDouble) before being encoded in Base64.

 

Continue to:















TOP
previous page: 06  What is encoding? (File Formats and Conversion - Macintosh)
  
page up: Telecommunications on Macintosh FAQ
  
next page: 08  a) What are AppleSingle and AppleDouble? b) What is MacBinary? (File Formats and Conversion - Macintosh)