Binhex 4.0 Converter

While BinHex 4.0 is used for encoding in HQX files, RLE is used for the compression. What makes HQX files predestined for file downloads on the internet or sending e-mail attachments is the fact that they couple combine both data and resource fork of the Mac file system to form only one archive. BinHex 4.0 (Mac abandonware from 1984) To date, Macintosh Repository served 1317179 old Mac files, totaling more than 254665.8GB!

  1. Bin2hex Tool
  2. Binhex 4.0 Converter Vs
  • Related Questions & Answers
  • Selected Reading
PythonServer Side ProgrammingProgramming

The binhex module encodes and decodes files in binhex4 format. This format is used in the representation of Macintosh files in ASCII. Only the data fork is handled.

Binhex


The binhex module defines the following functions −

binhex.binhex(input, output): Convert a binary file with filename input to binhex file output. The output parameter can either be a filename or a file-like object (any object supporting a write() and close() method).

4.0

Bin2hex Tool

binhex.hexbin(input, output): Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. The resulting file is written to a file named output unless the argument is None in which case the output filename is read from the binhex file.

(This file must be converted with BinHex 4.0)

To convert hex in binary format

Binhex 4.0 Converter Vs



Description

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

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:

  • prev: 06 What is encoding? (File Formats and Conversion - Macintosh)
  • next: 08 a) What are AppleSingle and AppleDouble? b) What is MacBinary? (File Formats and Conversion - Macintosh)