Version 12 of base64

Updated 2002-03-21 20:13:59

http://tcllib.sourceforge.net/doc/base64.html


Background: Base64 is a way to encode arbitrary binary data in such a way that the result contains only printable characters and are thus able to pass unchanged even through old applications which are not 8bit-ASCII clean.

Base64 is related to UUencoding in that it uses the same mechanism of distributing the bits in 3 bytes into 4 bytes. But it uses a different table to map the resulting data into printable characters.

The above means that base64 encoded data takes one-third more space than the data before the conversion.


The Cookbook includes an example [L1 ] which processes GIFs.


Base 64 encode/decode has been retired now - the Tcllib module is the recommended one.


There are incompatibilities between various base64 packages and versions of Tcl. CL has pursued this most; the root problem is a change in the semantics of binary. Tcl 8.0 with the base64 in tcllib 0.8 and before was definitely bad. This thread [L2 ] details this aspect of the change from 2.1 to 2.2 of the base64.tcl source code.


Please note that there is some base64 decoding support built into Tk which is different code than what is in tcllib. There may be other bits around as well. The reason this is important is when fixing bugs, etc.


CriTcl also has a Base64 implementation, see "ascenc" in [L3 ] and a critical mindset about policy


Category Package, subset Tcllib