|
|||||
|
|||
Functions | Platforms | ||
Character encodings, Base 64 (OMFFBASE64) |
Base 64 is used to encode binary data for applications that only accept text. It is commonly used in Internet Mail applications to send and receive binary data.
This library contains one OmniMark external source function and one OmniMark external output function implementation, as follows:
reader
is an external source function that reads a value source, its argument, and returns the binary data of that file converted from a Base 64 encoding to raw binary octets. That is, the provided source is in Base 64, but the program sees binary data.
Any input data not recognized as part of a Base 64 encoding is ignored. This is appropriate for white space and for characters used to quote the encoding (such as ">" in email messages), but may erroneously accept input that is not a valid Base 64 encoding.
writer
is an external output function that accepts raw binary data and writes that data to a value output, its first argument, converted from binary data to a Base 64 encoding. That is, the program writes binary data, but the provided output receives Base 64.
writer
has an optional first argument, heralded by width
, that is the line width of the Base 64 output. The default should be 76, in keeping with the specification for Base 64 encoding. The Base 64 output has line breaks, represented by a carriage-return/line-feed (CR+LF) sequence at most every that many characters (of the Base 64 encoding). The Base 64 output always has a CR+LF at its end.
The optional first argument of writer can alternatively have a value of zero (0), in which case no CR+LF sequences are produced, and the output consists entirely of encoded data.
The Base 64 encoding used is based on that described in IETF RFC 2045, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" .
To use omffbase64, you must import it into your program using a statement like this:
import "omffbase64.xmd" prefixed by base64.
(Please see the import
topic
for more on importing.)
Functions base64.reader base64.writer |
Platforms HP/UX IBM AIX Linux (Intel) MS Windows 98/ME MS Windows NT/2000/XP Sun Solaris |