Re: base64



On 2006-12-08, Allan Adler <ara@xxxxxxxxxxxxxxxxxxxx> wrote:

People often send me attachments. I normally can't read them because
I use the old unix style mail program and I will continue doing so.
The attachments and enclosures often show up in base64 encoding which
I am unable to read.

I just did a google search and found that there are base64 encoders and
decoders that run under Linux. I executed

locate base64

on this system and learned of

/usr/lib/python2.1/base64.py

That's a library module meant to be called by python programs.
I doubt it's very useful as a general-purpose stand-alone
utility.

You'd be better of using mimencode. I'm sure it's available
for just about any distro. On Gentoo, it's included in the
"metamail" package.

_____________________________________________________________________________

MIMENCODE(1) MIMENCODE(1)



NAME
mimencode - Translate to and from mail-oriented encoding formats

SYNOPSIS
mimencode[-u] [-b] [-q] [-p] [file name] [-o outputfile]

DESCRIPTION
The mimencode program simply converts a byte stream into (or out of)
one of the standard mail encoding formats defined by MIME, the proposed
standard for internet multimedia mail formats. Such an encoding is
necessary because binary data cannot be sent through the mail. The
encodings understood by mimencode are preferable to the use of the
uuencode/uudecode programs, for use in mail, in several respects that
were important to the authors of MIME.

By default, mimencode reads standard input, and sends a "base64"
encoded version of the input to standard output.

The (really not necessary) "-b" option tells mimencode to use the
"base64" encoding.

The "-q" option tells mimencode to use the "quoted-printable" encoding
instead of base64.

The "-u" option tells mimencode to decode the standard input rather
than encode it.

The "-p" option tells mimencode to translate decoded CRLF sequences
into the local newline convention during decoding and to do the reverse
during encoding. This option is only meaningful when -b (base64
encoding) is in effect.

If a file name argument is given, input is read from that file rather
than from standard input.

The "-o" option, which must be followed by a file name, sends output to
the named file rather than to standard output.

RATIONALE
Mimencode is intended to be a replacement for uuencode for mail and
news use. The reason is simple: uuencode doesn't work very well in a
number of circumstances and ways. In particular, uuencode uses charac-
ters that don't translate well across all mail gateways (particularly
ASCII <-> EBCDIC gateways). Also, uuencode is not standard -- there
are several variants floating around, encoding and decoding things in
different and incompatible ways, with no "standard" on which to base an
implementation. Finally, uuencode does not generally work well in a
pipe, although some variants have been modified to do so. Mimencode
implements the encodings which were defined for MIME as uuencode
replacements, and should be considerably more robust for email use.

SEE ALSO
metamail(1), mailto(1)

COPYRIGHT
Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)

Permission to use, copy, modify, and distribute this material for any
purpose and without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and
that the name of Bellcore not be used in advertising or publicity per-
taining to this material without the specific, prior written permission
of an authorized representative of Bellcore. BELLCORE MAKES NO REPRE-
SENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF THIS MATERIAL FOR ANY
PURPOSE. IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WAR-
RANTIES.

AUTHOR
Nathaniel S. Borenstein


Bellcore Prototype Release 1 MIMENCODE(1)

________________________________________________________________________________


--
Grant Edwards grante Yow! .. are the STEWED
at PRUNES still in the HAIR
visi.com DRYER?
.



Relevant Pages

  • Re: PEM Format Information
    ... the most current encoding set is ... "Base64" is a transformation which maps groups of three bytes into ... groups of four characters (chosen in a standard list of 64 characters, ... For instance, here is the PEM encoding of a 512-bit RSA key, using ...
    (sci.crypt)
  • Re: Trasferire file
    ... The Base64 Content-Transfer-Encoding is designed to ... The encoding and decoding algorithms ... as output strings of 4 encoded characters. ... that this may be done directly by the encoder rather than in ...
    (it.comp.macintosh)
  • Re: Got via http package a utf-8 encoded webpage ...
    ... Or do I have now to learn about this UTF, Unicode, ... ... more or less standard way, needs a more or less standard way to treat ... then select the correct encoding convertfrom. ... solution might well turn out to be a single line of Tcl code ...
    (comp.lang.tcl)
  • Re: RfD: Internationalisation
    ... this should be in the EXT word set as all bar one of the the existing ... incompatible character sets in standard programs. ... You are expecting TYPE to follow the current encoding, language, country ... I deliberately left out the changeable encoding from the xchar proposal, ...
    (comp.lang.forth)
  • Re: Attached image sent as "application/octet-stream"
    ... MIME has different encoding ideas, plus it describes the data it encodes (as an example, ... part of the encoded file is Content-Type) and MIME-QP is the default for HTML messages. ... happened when I sent messages in HTML format I have now changed the encoding from Quoted Printable to Base64, and now the files are attached properly. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)